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
To show last refresh date/time you can use Power Query
- Open Power Query Editor (Transform Data).
- Click New Source → Blank Query.
- Open Advanced Editor (View → Advanced Editor).
- Paste the following M code:
- let
Source = DateTime.LocalNow()
in
Source - Click Close & Apply.
- Rename this table to "Last Refresh".
- Use it in a card visual.
- MarkPalmberg1 year agoKudo Commander
Yes, those are the Google search results. But DateTime.LocalNow() still returns UTC datetime when published to the service, for whatever reason. Maybe it's a tenant setting we're missing, or something.