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?
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
400 | |
105 | |
68 | |
55 | |
49 |
User | Count |
---|---|
379 | |
118 | |
82 | |
67 | |
54 |