Refreshing datasets automatically with dataflows

Last modified date

Workspace showing the link from web to workspace to dataset to report.

I have a report, Open Issues, that has a Power BI dataflow as a data source. If I just use scheduled refreshes my options are limited. I could schedule the dataflow to refresh at 10am and the next slot available for the report dataset to refresh would be 10:30am. I need to be refreshing datasets automatically after the dataflow has finished so my reports are up to date as soon as possible. This can be done using Power Automate.

Create a flow in Power Automate

Head to Power Automate at https://flow.microsoft.com/ and click on Create on the left hand side menu. The flow will be triggered by the dataflow refresh finishing. This means it is automated so click on Automated cloud flow.

screen grab of Power Automate showing location of Create button and Automated cloud flow button

A dialog appears asking for details of the flow. You need to enter in a name for the flow. Then in the search box enter in power to find relevant triggers. Select When a dataflow refresh completes and click Create.

Build a flow dialog box

After you click Create the flow editor appears with the trigger already added. For Group Type select Workspace. Then you can select the workspace name for Group. Then you can select the Dataflow.

Trigger step showing values set for Group Type, Group and Dataflow

We then need to refresh the connected report dataset. So we click New step. In the Choose an operation dialog, we type dataset into the search box. This will find you the action Refresh a dataset. We click on the action to add it to the flow.

Adding the step to Refresh datasets automatically

Then you need to select the Workspace and Dataset in the action. The flow is complete, so we can click Save.

Testing the Flow

The flow triggers when the dataflow finishes refreshing. If we refresh the dataflow that will test the flow. I clicked refresh on the dataflow at 3pm and it triggered the flow which then refreshed the dataset.

Screen grabs of the workspace showing the refresh date and times and a screen grab from the flow runs showing the matching date and time.

In the workspace we can see the date and time of the refreshes and if the flow has worked correctly the dataset should be refreshed just after the dataflow. If you look at the history of the flow runs there should be a matching flow run just after the dataflow finished refreshing.

When refreshing datasets automatically fails

It is worth pointing out that if the dataset refresh fails the flow will not reflect that and will show succeeded in the flow runs. So it is worth checking that the dataset can refresh successfully.

Conclusion

This idea can be extended to refresh multiple datasets over multiple workspaces that are connected to the dataflow. This simplifies the process of scheduling refreshes. It also could allow for notifications to interested report owners to be told of the refreshes etc.

Over 20 year experience at being passionate about training, solving problems and loving a new challenge especially in the Microsoft's Power Platform suite.