Forum Discussion
last time refresh
- 10 years ago
Hi,
Maybe this will solution will help,
http://www.powerpivotpro.com/2010/11/add-a-last-refreshed-date-readout/
I will try tommorow and update :-)
- 10 years ago
Hi nir,
You can add a calculated column (Last Refresh Column) in the model with the formula =NOW()
And measure Last Refresh Date :=MAX(Table[Last Refresh Column])
Since calculated columns are calculated only on model refresh - it will make sure the calc is right
This worked for me and takes into account that when the auto refesh on PowerBI.com occurs it is done in GMT time:
Enter this M formula into a blank query in the get data button:
= DateTimeZone.ToLocal(DateTime.AddZone(DateTime.LocalNow(),-10))
The -10 is becasue I am +10 GMT. Not sure why it needs to be negative but it is.
Hope this works.
Giles
GilesWalker wrote:This worked for me and takes into account that when the auto refesh on PowerBI.com occurs it is done in GMT time:
Enter this M formula into a blank query in the get data button:
= DateTimeZone.ToLocal(DateTime.AddZone(DateTime.LocalNow(),-10))
The -10 is becasue I am +10 GMT. Not sure why it needs to be negative but it is.
Hope this works.
Giles
Giles,
Your formula was very helpful to me. However, instead of adjusting between two local timezones, I used UtcNow.
= DateTimeZone.SwitchZone(DateTimeZone.UtcNow(),-5)
- freder1ck8 years agoKudo Kingpin
Actually, that solution doesn't account for daylight savings time. Reza Rad has a comprehensive post on the problems here:
http://radacad.com/solving-dax-time-zone-issue-in-power-bi
Solution 3 presents two ways to get the current time from a website. The first of these ways works for me, but I'm going to try the XML version also.