Forum Discussion
Last Refresh date/time from Power Service in Power BI Desktop report
- 4 years ago
Could you just create a custom column in Power Query and use:
DateTime.LocalNow()#"Added Custom" = Table.AddColumn(#"Changed Type", "LastUpdate", each DateTime.LocalNow())
Then format it as DateTime
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"LastUpdate", type datetime}})
This should then show wich time the table was refreshed as it will update the column with current date and time.
M code:let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUpMSlaK1YlWMkJiGyOxTWDsWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Dummy = _t, Abc = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Dummy", Int64.Type}, {"Abc", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "LastUpdate", each DateTime.LocalNow()),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"LastUpdate", type datetime}})
in
#"Changed Type1"Marius
Hello all,
I went through most of the advices but I still not sure that the outcome is correct.
No matter either we create a dax (Last Refresh = NOW()) or new query (=DateTime.LocalNow()), both will give same results; however they only reflect the local time.
Our goal is to let the users know when the last dataset was refreshed, not when the visual was last refreshed.
For insatance my dataset refreshes at 6:00am, 12:00pm and 4:00pm. The users will not exactly know that what time the dataset was refreshed. I will tell you the reason because the logic we are using to add the card visual to show the last refresh time will always show the local date/time whenever the user opens the report. So, this date/time is not the same as when the sementic model was refreshed. Does that make sense?
I don't belive that PBI has such feature available to show the actual time of dataset refresh as of now.
Hope PBI team will bring this feature in future updates.
Expert, please add your comments on this, I might be wrong.
Thanks,
pthapa