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?
User | Count |
---|---|
367 | |
101 | |
67 | |
57 | |
47 |
User | Count |
---|---|
325 | |
114 | |
84 | |
71 | |
60 |