Power BI: Create and Display a Dynamic Last Refreshed Timestamp

This article covers creating and displaying a “Last Refreshed” timestamp in Power BI. This timestamp will automatically update each time the semantic model is refreshed, ensuring the audience can easily verify that they are reviewing the most recent data.

Instructions

Step 1: Create a Last Refreshed Timestamp

This step uses Power Query to create a dynamic table containing the current local date and time. This value updates each time the semantic model (queries/data) is refreshed and remains static until the next refresh.

  1. From the Home tab in Power BI, click Get data and select Blank query.
  2. The Power Query window is displayed.
  3. From the Home tab in Power Query, click Advanced Editor.
  4. Replace any existing code with the following:
let
  Source = #table(type table [#"LAST REFRESHED" = datetime], {{DateTime.LocalNow()}})
in
  Source

NOTE: The example uses DateTime.LocalNow(), which returns the client machine’s local time when viewing the report in Power BI Desktop. Other options include DateTime.FixedLocalNow(), DateTimeZone.LocalNow(), and DateTimeZone.FixedLocalNow(). However, keep in mind that with any of these LocalNow functions, the timestamp will display in UTC when the report is viewed in the Power BI service, creating a mismatch between the local time in Power BI Desktop and UTC in the cloud. Consistency can be maintained using DateTimeZone.UtcNow() or DateTimeZone.FixedUtcNow() to display the timestamp in UTC in both Power BI Desktop and the Power BI service.

  1. Click the Done button to close the Advanced Editor window.
  2. From the Query Settings pane under Properties, change the Name to a relevant name for Power BI (for example, TBL_META_DATA).
  3. From the Home tab in Power Query, click Close & Apply.
Screenshot of a query to create a new table containing the last refreshed date using the current date and time in Power Query.
Power Query: New Table Containing the Last Refreshed Timestamp

Step 2: Create and Format a Last Refreshed Measure

With TBL_META_DATA available in the Data pane, the next step creates a measure to use in a text box.

  1. From the Data pane, highlight TBL_META_DATA.
  2. From the Table tools tab, click New measure.
  3. Enter the following expression formula (adjust the format as needed):
MEASURE_LAST_REFRESHED
  = FORMAT ( MAX ( TBL_META_DATA[LAST REFRESHED] ), "dddd, mmmm d, yyyy" )
Screenshot of a new measure containing the formatted last refreshed timestamp in Power BI.
Power BI: New Measure Containing the Formatted Last Refreshed Timestamp

Step 3: Insert Text Box to Display Last Refreshed Timestamp

The following step adds a text box to show the timestamp on the report.

  1. From the Insert tab, click Text box.
  2. The Create a dynamic value that updates with your data box is displayed.
  3. In the How would you calculate this value field, enter MEASURE_LAST_REFRESHED.
  4. The Result displays the formatted value of the field.
  5. Click the Save button.
  6. Customize the text box by adding static text if needed (for example, Semantic Model Last Refreshed).
Screenshot of a text box configuration to display a dynamic value in Power BI.
Power BI: Text Box Configuration to Display a Dynamic Value in Power BI

Results

Every time the report refreshes, whether manually or on an automatic schedule, the timestamp updates. Since the text box uses a dynamic value, the latest refresh date is always shown in the report.

Screenshot of a Power BI report displaying the semantic model last refreshed date.
Power BI: Report Displaying the Semantic Model Last Refreshed Date

Summary

These steps produce a dynamic “Last Refreshed” timestamp that updates automatically with each data refresh, keeping the report’s audience informed of the most recent refresh date.