Forum Discussion
Anonymous
8 years agoNot applicable
Calculated date wrong on Power BI Server
I have a "Last Refresh Date" field in my report that is populated from a manual query: let Source = #table(type table[LastRefresh=datetime], {{DateTime.LocalNow()}}) in Source When I run it l...
- 8 years ago
Hi Anonymous,
Based on my test, the DateTime.LocalNow() function will display in UTC time ignore the local region setting. So the report data is different from schedule refresh time.
Best Regards,
Qiuyun Yu
Grumelo
8 years agoAdvocate II
I had the same issue, date refreshed in Power Bi Desktop is not the same once calculate in Report Server Schedule Refresh.
I've solved the problem by adding my timezone
let
Source = #table(type table[LastRefresh=datetime], {{DateTime.LocalNow()}}),
#"LocalDateTime" = Table.AddColumn(Source, "LastRefeshLocal", each DateTime.AddZone([LastRefresh],1), type datetimezone)
in
#"LocalDateTime"
- Anonymous8 years agoNot applicable
That works great, thanks very much :)
I'll just need to remember to adjust when daylight savings ends.