Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello all,
I have a basic question on How to add a card visual to show last dataset refreshed date and time in power bi visual?
I have watched few youtube videos on insturctions on the last refresh but everyone says the same thing and actually it doesn't work, and the reason below.
1. First this is how I created a dax to calculate the local time.
Last Refresh = Now() -(5/24) //Reason I am subtracting 5hrs is because when the report is published in web(service), time will go back to UTC time so in order to get my local time, I have to subtract the time difference)
2. Second added a card visual with the Last Refresh value on it.
3. Now, question is if my dataset refreshes multiple times during day; how can the 'Last Refresh' be the same as what time my dataset is refresh?
4. If I go to the workspace and open the report. Then refresh my browser, the time on the card visual will also refresh to my local time and this is not I want. I want to show the report user when was the last sementic model refreshed.
Please provide some feedbacks to this.
Appreciate your time.
Have a great day/evening.
Pthapa
Solved! Go to Solution.
Hi, @pthapa
If you want to get the refresh time through the API. Here is my idea:
Since we need to use the access token in the process of calling Power BI's API, this access token has a life cycle and will expire after about 1 hour. When the token expires, we need to refresh the token before we can continue to call Power BI's API. So, first of all, we need to consider the following points when writing Power Query M code:
1. There is a Power Query M code method for obtaining Power BI's access token
2. You also need to establish a method to check whether the current token time exceeds one hour. If it exceeds, you need to re-call the previous method of obtaining Power BI's access token.
3. You need to write a method to call Power BI's API interface to obtain the semantic model refresh history, and format the returned json format data to extract the start refresh time and end time and refresh status you want
4. With this data, you can use this data in your report for visualization.
The above is an implementation that requires you to have a deep understanding of Power Query M code and understand the relevant knowledge of API. If you decide to continue to study these contents in depth, you can refer to the following articles I found, which will inspire you:
PowerBI REST API & Access Token with Power Query - Microsoft Fabric Community
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
just add a calculated table, add a column to capture datetime - set its value using NOW() - This date will update each time the model refreshes
Hello @Anonymous ,
Thanks for sharing the post however they do not work.
I have commented the reason in this post below.
pthapa
Hi @pthapa ,
You can build a master report to track the refresh of your reports.Capture the refresh status to SharePoint Excel using power automate and you can track them on power bi report.
I hope it will helpful.
Thanks,
Sai Teja
Hi, @pthapa
If you want to get the latest time a semantic model refresh, you'll need to use the REST API in Power BI, which is a viable way to do it at the moment:
Datasets - Get Refresh History - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous ,
Appreciate your response, however I am still trying to understand the steps to follow.
Do you by chance know the proper steps that I need to follow?
Thanks,
pthapa
Hi, @pthapa
If you want to get the refresh time through the API. Here is my idea:
Since we need to use the access token in the process of calling Power BI's API, this access token has a life cycle and will expire after about 1 hour. When the token expires, we need to refresh the token before we can continue to call Power BI's API. So, first of all, we need to consider the following points when writing Power Query M code:
1. There is a Power Query M code method for obtaining Power BI's access token
2. You also need to establish a method to check whether the current token time exceeds one hour. If it exceeds, you need to re-call the previous method of obtaining Power BI's access token.
3. You need to write a method to call Power BI's API interface to obtain the semantic model refresh history, and format the returned json format data to extract the start refresh time and end time and refresh status you want
4. With this data, you can use this data in your report for visualization.
The above is an implementation that requires you to have a deep understanding of Power Query M code and understand the relevant knowledge of API. If you decide to continue to study these contents in depth, you can refer to the following articles I found, which will inspire you:
PowerBI REST API & Access Token with Power Query - Microsoft Fabric Community
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @pthapa
You can adjust your expression to show the last refresh time from the following article:
3 Ways to Add Last Refresh Date in Power BI - Power Tech Tips
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.