DAX Measure to Dynamically Offset Datetime Based on Daylight Savings Time | Sandeep Pawar
DAX Measure to Dynamically Offset Datetime Based on Daylight Savings Time | Sandeep Pawar
A quick measure to calculate time based on US Daylight Savings Time
Nice... Similar way i did here..
Current EST_Today =
VAR UTC_DateTime = now() // Variable to hold the original UTC datetime value from your table. VAR Year = YEAR(UTC_DateTime) // Extracts the year from the UTC datetime to calculate DST boundaries for that specific year. VAR DST_Start = DATE(Year, 3, 14 - WEEKDAY(DATE(Year, 3, 8), 2)) // Calculates the start of DST (Second Sunday in March). VAR DST_End = DATE(Year, 11, 7 - WEEKDAY(DATE(Year, 11, 1), 2)) // Calculates the end of DST (First Sunday in November). VAR IsDST = IF(UTC_DateTime >= DST_Start && UTC_DateTime < DST_End, -4, -5) // Determines if the datetime falls in DST period; adjusts offset to -4 for DST (EDT), otherwise -5 for standard time (EST). VAR LocalDateTime = UTC_DateTime +IsDST/24 RETURN FORMAT(LocalDateTime, "M/DD/YYYY HH:MM AM/PM")
https://community.fabric.microsoft.com/t5/Desktop/Get-Time-from-DateTime-field/m-p/4266177#M1340416