As you all might already know, TODAY() function returns UTC time when published to Power BI Service. Our requirement is to return the local (EST) date. As a solution, we created a custom measure that adds UTC offset hours for EST in NOW() and returns the resultant date.
However, this does not handle daylight saving changes as offset changes during these periods.
What are the possible ways to handle this?
In Power BI, if you have been using date and time data for long enough, you may have noticed a peculiarity with how your time works in Power BI Desktop, compared to Power BI Service. This is because Power BI Desktop uses your computer's local time, whereas Power BI Service uses UTC time.
You can try something like this:
ESTnow=
VAR currentTime = NOW()
VAR timeYear = YEAR(currentTime)
VAR dstStart = DATE(timeYear, 03, 14 - MOD((1+FLOOR(timeYear*5/4,1)),7)) + TIME(2,0,0)
VAR dstEnd = DATE(timeYear, 11, 7 - MOD((1+FLOOR(timeYear*5/4,1)),7)) + TIME(2,0,0)
RETURN IF(currentTime >= dstStart && currentTime <= dstEnd, currentTime - TIME(4,0,0), currentTime - Time(5,0,0))
Daylight savings start on the second Sunday of March and end on the first Sunday of November.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With