Business users often need to know how fresh the data is that they see on a Power BI report. This requirement can be interpreted to mean either “when was the last date & time that the source data was updated?” or “when was the last date & time that the data model was refreshed?” This method will work with either requirement, but the example will address the latter case.
I’ve used a few different approaches to record the actual date and time, but all generally using the same technique. I will often create a small table in the model containing version information and revision notes, and then add the last refresh date to that table. This is easy accomplished using the Enter Data feature to add rows to the table right in Power BI Desktop. I discovered that often times if records in the utility table weren’t changed or added, the refresh date wouldn’t get updated and it would take more than one scheduled refresh cycle to see the refresh date. Using a column in an actual fact table has proven to be more reliable. If the definition of “last refresh date” is when data at the source was updated, then use a column in the source database table that gets updated in the ETL process or database. If you need to get the last data model refresh, you can use the following technique to create a custom column in Power Query. Regardless, you can create a measure from the appropriate column using DAX.
Here, a custom column is added to the main fact table in Power Query. This records the current date and time every time this table is refreshed in the dataset.
Even if the table is partitioned, returning the MAX value from this column will yield the last refresh date and time.
The measure is very simple:
Using a card, this measure can be placed on any report page to show users how current the data they are viewing is.