Showing a last refresh date and time in Power BI report let you know how fresh your report data is as sometimes report viewer can not remember the last date and time when report data was refreshed. Just in case, when you never refresh the report, Power BI keeps showing an existing data until the report is not refreshed therefore it will be better to add a last refresh date in Power BI report.
Lets see how to add a last refresh date and time in Power BI report.
Open Power Query Editor by clicking on Transform data tab.
Now under Home tab, click on New Source then select Blank Query.
Under Queries pane, you will see a newly created query as query1. Just right click on that and rename it as DatetimeRefresh.
After that, go to formula bar and write below M query.
In case, formula bar is disable for you then go to under View tab check the Formula Bar option.
Now we will convert this date data into table format, for this just right click on To Table tab then select To Table option.
Now once you click on To Table, you will it is converted into a single column table.
Lets give a name to column as LastRefreshedDate.
After that, click on Close & Apply tab to save the changes.
Now you can see, a table is created which returns the last date time of refresh.
Lets take a card visual and drag LastRefreshedDateTime column into visual.
You can see, it is showing last refreshed date and time.
Lets refresh the report page or you can say data model, just click on Refresh tab.
You can see last refreshed data time get changed accordingly.
4,685 total views, 3 views today
Have you considered implementing a UTC time and adjusting it to the relevant Timezone offset values?
When you upload the DateTime.LocalNow() dataset, the time it returns depends on the location where the refresh takes place.
To always return the correct value, you can retrieve the UTC value instead, and return summertime between the last sunday of march and the last sunday of october.
All you need is the parameters of the country you report in. You can read some more on that here: https://gorilla.bi/power-query/last-refresh-datetime/
Hi Rick, Thanks for sharing your learning, this is really useful. Much appreciated.