Create field to display last refresh date and time
This is a code block, entered through the query editor, that will give you a timestamp for the last time a Power BI data set was refreshed. To make this as accurate as possible, place it as the last query.
We use this to ensure users can see when the data was last updated and we may incorporate it on to a primary page or the header / footer of each tab as a simple field value via a KPI widget.
/* Script for advanced editor to add in last refreshed field */ let Source = DateTime.LocalNow(), #"Converted to Table" = #table(1, {{Source}}), #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Last Refreshed Date"}}), #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Last Refreshed Date", type datetime}}) in #"Changed Type"