I have a report that is scheduled to refresh once daily and I need to show the users when the report's dataset was last refreshed.
I understand that refreshing a query via service with a DateTime.LocalNow() formula will return the server's timezone instead of the report author's/dataset owner's. Instead, I'm using DateTimeZone.UtcNow() then convert it to my timezone ( +8 ) using DateTimeZone.SwitchZone. Like DateTime.LocalNow(), DateTimeZone.UtcNow() works fine when refreshed via desktop but is showing a time 8 hours late than than my current time when refreshed in the service. For example, I refreshed the data set 12 noon my time but the report is showing 4 am instead.
Please let me know what I am missing.
Solved! Go to Solution.
Power BI service shows the current date and time in UTC. To solve this issue, you may try the following ways:
Power BI service shows the current date and time in UTC. To solve this issue, you may try the following ways:
DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),timezoneHours,0) works. Thanks for this.
By the way, would you know what timeonze DateTimeZone.UtcNow() is using?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!
User | Count |
---|---|
221 | |
68 | |
67 | |
62 | |
57 |
User | Count |
---|---|
251 | |
215 | |
92 | |
89 | |
73 |