Steps to Add Last Refreshed Date
Step 1: Open Power BI Desktop
Launch Power BI Desktop and click on the Transform Data option.
Step 2: Create a Blank Query
From the Home ribbon, click on New Source and select Blank Query.
Step 3: Rename the Query
Once the Blank Query table (named "Query1") appears under the Queries section, right-click on it and rename it to Last Refreshed Date.
Step 4: Add M Code in Advanced Editor
Now, open the Advanced Editor from the Home ribbon and paste the following M code:
M Code:
let
Source = #table(type table[Date Last Refreshed=datetime], {{DateTime.LocalNow()}})
in
Source
Once you paste the code, click on Done.
This M code creates a column named Last Refreshed Date, containing the current date and time. The date will update every time you refresh the dataset.
Step 5: Apply Changes
Click on Close & Apply to save and apply the changes.
Step 6: Display Last Refreshed Date in the Report
To show the last refreshed date, you can use either:
-
A Card visualization
-
A Text Box, depending on the available space in your report.
Conclusion
Adding a last refreshed date detail in your Power BI report helps users understand data freshness and ensures that automatic refreshes are working as expected.
I hope you found this blog helpful! 🚀
Best Regards
Anmol Malviya
Sr. Data Analyst | Addend Analytics