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
You can show this on a tile in a dashboard by clicking the ... on the top right hand corner of the tile, then click the edit pencil, then check the "Display last refresh time". The refresh time will now show at the top of the tile
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
- freder1ck8 years agoKudo Kingpin
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.
- Virtual_Ames10 years agoMicrosoft Employee
I believe this is the right solution to the time issue - but it is not clear how to enter the M code. Blank query does not indicate a clear path to entry.....
Could you perhaps clarify your answer a bit? I'd like to implement this and test....
Thanks,
Brian
- Anonymous8 years agoNot applicable
is there any way to kno wwhether the refresh is happening of the server of Locally? so that we can code this consistently?