With all the data flowing within companies, we needed a way to track the last time Power BI reports were updated, either manually or via nightly refresh. Enter, Last Data Refresh Date & Time (I’m still working on the name).
Steps:
Open Power BI Desktop
Click on New Source and select Blank Query
Rename dataset to Last Data Refresh
Open the Advanced Editor
Paste in the following code:
let Date = DateTime.From(DateTimeZone.SwitchZone(DateTimeZone.FixedLocalNow(),-5)), #"Converted to Table" = #table(1, {{Date}}), #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Last Refresh Date"}}), #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Last Refresh Date", type datetime}}) in #"Changed Type"