Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cris31
New Member

Display the end time of a dataset refresh in Power BI Service

Hi everyone,

I want to display the last dataset refresh end time directly in my Power BI report published in the Service. Also, the dataset takes about 90 minutes to refresh, so showing only the start time of the refresh isn’t helpful, I need the actual end time.

What’s the recommended approach to achieve this?

I’ve read that the Power BI REST API (Get Refresh History) or Power Automate could help, but I’m not sure how to implement this in practice.

Has anyone managed to get the refresh end time into a report in the Power BI Service?

 

Thanks in advance for any suggestions!

 
 
 
 
 
 
 
 
1 ACCEPTED SOLUTION

Hi @cris31 ,

When creating a Power Automate flow, you can add a step that triggers a refresh of a Power BI dataset. However, once the refresh command is sent to the Power BI service, the flow continues without knowing when or even if the dataset has finished refreshing. Depending on the dataset, this refresh process could take anywhere from a few seconds to several minutes.

To handle this, you need write access to the dataset. The approach involves adding a new table to the dataset that holds a timestamp. This timestamp gets updated automatically whenever the dataset is refreshed.

In Power Automate, before triggering the refresh, the flow will first query the dataset to retrieve the current value of this timestamp. That value is stored as a reference. After that, the dataset refresh is triggered.

While the dataset is being refreshed, the flow enters a loop that checks the timestamp about every 500 milliseconds. The loop ends once it detects that the timestamp is newer than the previously stored one, confirming that the refresh is complete.

Follow the below steps:

Modify your Power BI dataset, For example:

Go to Transform Data in Power BI Desktop.
Add a blank query.
Open the Advanced Editor and replace the existing code with:

let
Source = Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0)),
Source1 = Date,
Source2 = Purchases,
Source3 = Sales,

// Add more sources for each table you want to refresh

#"Converted to Table" = #table(1, {{Source}}),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "RefreshTime"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"RefreshTime", Int64.Type}})
in
#"Changed Type"

Name this new table RefreshTable.

Build the flow in Power Automate:

Trigger: Start the flow using any desired trigger.

Block 1 – Query the dataset:
Use the “Run a query against a dataset” action in Power BI with the following DAX query:
EVALUATE(ROW("TimeStamp", MAX(RefreshTable[RefreshTime])))

Block 2 – Initialize variable (PrevTime):
Store the timestamp from the previous block in an integer variable named PrevTime using this expression:
outputs('QueryPrevTime')?['body/firstTableRows'][0]['[TimeStamp]']

Block 3 – Refresh the dataset:
Add the Power BI action to refresh the dataset.

Block 4 – Initialize variable (NewTime):
Create an integer variable named NewTime and set its value to 0.

Block 5 – Do Until loop:
Create a loop that continues until NewTime > PrevTime. Inside the loop:

Block 5a – Query the dataset again with the same query as Block 1.

Block 5b – Set the value of NewTime using the same expression from Block 2.

This setup allows the flow to monitor the dataset refresh in real-time and only continue once the refresh has completed successfully.

Best Regards,
Chaithra E.

View solution in original post

6 REPLIES 6
dataflip
Kudo Kingpin
Kudo Kingpin

Yes, you're right — Power BI does not natively expose the refresh end time within the dataset itself, but you can achieve this by combining Power BI REST API with Power Automate or Azure Logic Apps.

v-echaithra
Community Support
Community Support

Hi @cris31 ,

We would like to confirm if you've successfully resolved this issue or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.

Thank you for your patience and look forward to hearing from you.
Best Regards,
Chaithra E.

lbendlin
Super User
Super User

Obligatory note that the "Last Refreshed"  time is largely meaningless.  Instead, find a suitable date column in your fact table (like "Latest Order Create Date" ) to indicate data freshness.

DataVitalizer
Solution Sage
Solution Sage

Hi @cris31 

 

Yes, you can use Power Automate to get the latest refresh info via the Power BI REST API, extract the endTime, and push it to a dataset, then connect your report to that dataset to display the refresh time.

 

Want a step-by-step on how to set it up?

 

Did it work 👍 A kudos would be appreciated ‌‌📢 Mark it as a solution to help spreading knowledge

Yes, a step-by-step guide would be great. I’d really appreciate that! 😊
Thanks in advance for your help!

Hi @cris31 ,

When creating a Power Automate flow, you can add a step that triggers a refresh of a Power BI dataset. However, once the refresh command is sent to the Power BI service, the flow continues without knowing when or even if the dataset has finished refreshing. Depending on the dataset, this refresh process could take anywhere from a few seconds to several minutes.

To handle this, you need write access to the dataset. The approach involves adding a new table to the dataset that holds a timestamp. This timestamp gets updated automatically whenever the dataset is refreshed.

In Power Automate, before triggering the refresh, the flow will first query the dataset to retrieve the current value of this timestamp. That value is stored as a reference. After that, the dataset refresh is triggered.

While the dataset is being refreshed, the flow enters a loop that checks the timestamp about every 500 milliseconds. The loop ends once it detects that the timestamp is newer than the previously stored one, confirming that the refresh is complete.

Follow the below steps:

Modify your Power BI dataset, For example:

Go to Transform Data in Power BI Desktop.
Add a blank query.
Open the Advanced Editor and replace the existing code with:

let
Source = Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0)),
Source1 = Date,
Source2 = Purchases,
Source3 = Sales,

// Add more sources for each table you want to refresh

#"Converted to Table" = #table(1, {{Source}}),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "RefreshTime"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"RefreshTime", Int64.Type}})
in
#"Changed Type"

Name this new table RefreshTable.

Build the flow in Power Automate:

Trigger: Start the flow using any desired trigger.

Block 1 – Query the dataset:
Use the “Run a query against a dataset” action in Power BI with the following DAX query:
EVALUATE(ROW("TimeStamp", MAX(RefreshTable[RefreshTime])))

Block 2 – Initialize variable (PrevTime):
Store the timestamp from the previous block in an integer variable named PrevTime using this expression:
outputs('QueryPrevTime')?['body/firstTableRows'][0]['[TimeStamp]']

Block 3 – Refresh the dataset:
Add the Power BI action to refresh the dataset.

Block 4 – Initialize variable (NewTime):
Create an integer variable named NewTime and set its value to 0.

Block 5 – Do Until loop:
Create a loop that continues until NewTime > PrevTime. Inside the loop:

Block 5a – Query the dataset again with the same query as Block 1.

Block 5b – Set the value of NewTime using the same expression from Block 2.

This setup allows the flow to monitor the dataset refresh in real-time and only continue once the refresh has completed successfully.

Best Regards,
Chaithra E.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.