Forum Discussion
Issues with Time Calculations(M/Power Query & Dax) in PowerBI Service (EST & UTC)
The service is always in UTC. You need to use the DateTimeZone functions in Power Query so the data will work in both the desktop and service. The DateTimeZone.SwitchTimeZone function is particularly useful.
DateTime.Date(DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),-8))
That will return the current time in the Pacific timezone in the service (which is -8 offset to UTC). Power BI Desktop will also recognize this, so it will be in sync.
You can see this in use in this article. That might help put it in context. Add a Refresh Time Stamp To Your Power BI Reports — ehansalytics
- jaykiu3 years agoFrequent Visitor
I see that it takes the datetimelocal.now() if I was using this to transform a column / create custom column. Would it be
DateTime.Date(DateTimeZone.SwitchZone([DateTimeColumn],-8))?
- edhans3 years ago
Community Champion
It depends on the value in that column. If there is no timezone, you'd need to build it by splitting it out, then reassembling it in the #datetimezone - PowerQuery M | Microsoft Learn function.
- edhans3 years ago
Community Champion
You will need to play with it. The DateTimeZone.From can often convert to a timezone, then allow you to switch timezones.