In this post, I’m going to demonstrate how you can use Power Automate in Power BI to create a button within the report that will refresh the data for the end-user. The example I’ll use is a Power BI report from the Top 100 last post in the Power BI Community forum. You can watch the full video of this tutorial at the bottom of this blog.
Downloading The Power Automate Visual
You don’t need this report to be on a regular refresh. You can open it up and then refresh the data. To go about doing this, I’ll go to the visualizations pane and click on Get more visuals to go to the App Source.
Then I’m going to type Power Automate in the search bar.
Once I see Power Automate, I’m going to click the Add button.
Now, we can see the Power Automate icon in the available visuals.
I’m going to click on it and it will create one for my report. There’s a lot of information here, but all you have to do is click down here on the three dots and choose Edit.
Creating A New Flow
Now, what this does is it opens the Power Automate screen in Power BI, just like it would if you went to flow.microsoft.com and created a flow.
I’m going to create a new flow and do an instant cloud flow.
This means there’s no real trigger except for the button that I want to press in Power BI. You can see that the Power BI button clicked does not do anything here since it has already figured how to do things.
So let’s click on the Next step button and go to Power BI.
You can see here that we have four actions available. I’ll choose the last option, Refresh a dataset, because it already knows who I am since I have been authenticated.
I just have to click on the dropdown list and it will show me a list of all my workspaces. I published the report to the Community.
And then I’ll go ahead and pick the report which I need to refresh with Power Automate. Then I click on Save.
At this point, my flow is done but I don’t want to go back to the report just yet. So I’ll just go ahead and click on the Back button.
Applying The Flow
And then I’ll go back to my list of flows. I can now select the one that I just created and click on Apply.
We can now see the green message that says I have successfully applied this flow, which means I can now click on the Back to report button.
Adjusting The Button Placement And Formatting
As you can see, I have a very large button for my flow on the report.
So I’ll make it smaller and put it on top.
I can click on the Format icon and change the button text from default to Refresh Data.
And then change the fill to a blue color.
Saving And Republishing The Report
You can see that the Refresh Data button is done now. If you want to test it out while on the Power BI desktop, just like any other button you will hold it down, press Control, and click on it.
I’m going to save and republish the report, and show you what it looks like on the Power BI service.
I had to replace what was previously done in the report.
Now, I’m going to click on the report to open it up and I’m going to click the Refresh data button to trigger the refresh.
It’s not going to report back if it succeeded or failed. This is just going to trigger the flow. If you know how long a report refreshes, you can just wait and refresh it to see if it updates or not.
But you can also go to your Flows. I can log in to flow.microsoft.com to see the one I just created.
If you click on the Flow, it will show you the 28-day history. We can see that it ran a couple of seconds ago and that the refresh was successful.
And if we go back to my report and refresh it, we can see the new data coming in. We see some stuff coming in from 7pm onwards. We can click on any of these links to see the new data.
***** Related Links *****
New Enterprise DNA Masterclasses: Power Apps and Power Automate
Power Apps: Getting Started With This Revolutionary Tool
Last Refresh Date & Time In Power BI – Updated Solution
Conclusion
In this tutorial, you learned how to create a Flow that triggers a dataset refresh. This is great for reports you want to refresh manually.
If you enjoyed the content covered in this particular tutorial, please subscribe to the Enterprise DNA TV channel for more content similar to this. Our goal is to improve the way that you use Power BI and the Power platform.