While Power BI has always been a part of the Power Platform, it never feels that way. So often the focus has been integrating Power BI into Power Apps. But what about Power Automate? Is there a way for us to integrate some automation with our Power BI content?
The short answer is yes! There are a lot of components to consider with your solution. Spend a little time brainstorming and you will discover a world of possibilities! The trick is to consider what value that automation can bring with just a little innovation!
What is Power Automate?
Power Automate is the automation pillar within the Microsoft Power Platform. Focused on repetitive and menial tasks, Power Automate is designed to free your time to focus on more value-add activities. You create “flows” that start with a trigger and then have subsequent actions that are executed within the context of the flow.
To create a flow, you can navigate to Power Automate and sign in. From there, you can start typing into Copilot to tell it what you want to do. However, you might want to just explore some ideas. For that, you can go to the templates section on the right or just click create to start from scratch!

To help you with your journey, let’s take a moment to understand what triggers and actions are.
Flow Triggers
When you create a new flow, you must initiate it with a trigger. There are three primary types of triggers:
- Automated Cloud Flows
- Instant Cloud Flows
- Scheduled Cloud Flows

While there are some other options to use on the create screen, we will focus on these three. The difference between the triggers is pretty simple. Automated cloud flows initiate when something happens like a new file is created or an email arrives. Scheduled flows happen on a particular cadence. This is just like a scheduled refresh in Power BI. Instant flows are initiated with a click of a button.
Flow Actions
Now that you have created a flow and assigned a trigger, you must assign at least one action. Actions are essentially automation steps that can be taken within the flow. You can click the plus sign under your trigger to add an action:

On the left-hand side of the editing screen, you can search for different actions or applications. You can select an application to see what actions are available. A great option to look at is Microsoft Teams. Some actions you can do include create a message or chat, schedule a Teams Meeting, or post an adaptive card and await a response as just a few options:

One other benefit within Power Automate is that we can call data from the initial trigger and previous actions. In our example, this flow is being manually initiated with a button from the Power Automate app. By initiating the flow in the mobile app, we are able to capture some location data. I can call that data dynamically within my flow:

At this point, I hope you are already thinking about what actions you could take with Power BI inside of Power Automate!
What about this “Premium” label?
This always comes up when I talk about anything with the Power Platform. What does the premium label mean? In short, it means you need to pay for some additional licensing to use this action or trigger.
When you look at the actions and triggers available to you, there are generally three types. Built in items are always available. Standard items are available assuming you have the application licensed and enabled for the user. This generally applies to the entire Microsoft 365 stack in addition to some other third-party SaaS solutions. Examples include Google Drive, Gmail, Dropbox, Box.com, and others of that ilk.
The last group, premium items, require you to pay for some form of premium licensing. This includes SQL connectors, Azure DevOps, Dataverse, AWS services, and others. If you want to use data out of your SQL server, you need to have a premium connector.
Or do you?
Power BI Actions in Power Automate
If you know me, you know that I like doing things as efficiently as possible. I hate watching my customers pay for licensing they do not need. I also do not condone the circumvention of licensing and recommend you invest to do things the right way every time. With that said, sometimes we can get creative with our solutions to obtain a goal.
This is why I feel getting a plan together early helps. If you understand the actions and touch points you are looking to use, you might be able to save a few dollars here and there. Not every organization has funds available to achieve goals. However, a little strategy could get you there quickly!
Querying your Semantic Model
If you take a look at the actions you have available to you for Power BI, you will note that there are several options. One of those options is to query a Power BI dataset. Yes, it should say semantic model instead, but Power Automate has not caught up yet. If you leverage this action, you can write a query in DAX and run it against your model. Below is a sample query I have that I can use with my Van Arsdel Sales model:
DEFINE
VAR _SalesSummary =
SUMMARIZECOLUMNS(
'bi_manufacturer'[Manufacturer],
'bi_product'[Segment],
"Quantity", 'ReportMeasures'[Quantity],
"Revenue", 'ReportMeasures'[Revenue]
)
EVALUATE
_SalesSummary
ORDER BY
[Revenue] DESC,
'bi_manufacturer'[Manufacturer],
'bi_product'[Segment]
This is a simple query that I wrote, but I can now apply it against my model:

Now think about this for a minute – I just used Power Automate to query data that is being refreshed from my SQL Server! Am I violating the licensing terms? No! Instead, I am leveraging the existing investment I have made in Power BI licensing. That is pretty cool!
Now, this might not always work for everyone. Real time data would still need to connect to a SQL server directly. However, if that is not a requirement, you might be able to avoid buying additional licenses by thinking through how you connect to your data in Power Automate.
But what else could I do?
Export Reports to a File
I can already hear the groans on this one. However, hear me out. For many organizations, they would like to create a way to share reports and dashboards with customers. Exporting this data to a file does take away the interactive piece. But is there a valid use case for this? There might be!
The first thing I can do is identify the report I want to export to a file. You select the workspace and report that will be exported and define the parameters for the job. You can select file to be in PDF, PNG, or PowerPoint format. In addition, you can provide a filter like I did on the manufacturer. I am not going to bore you with the filtering details, but you can reference this Microsoft Learn article for more information. I also suppressed my hidden pages for the time being:

Now that I have an action exporting the data, I can attach it to an outbound email. For that, I just need to place the dynamic content from the export into the attachment field and I am good to go:

Now I know some of you are already thinking about ways to reduce your licensing already with Power BI Capacity or Fabric Capacity. Remember, you are leveraging existing licensing. Unfortunately, this one requires you to still maintain capacity licensing on the Power BI side. But why would I do this instead of sharing it directly with others or embedding into a web portal?
What I like about this approach is that you could create a list of customers and contacts that you could put together and simply send these reports. If you are not a web developer or comfortable with the idea of external sharing, you could put this together pretty quickly. As long as your report is within a workspace that has a capacity assigned, you could do this on your own with just a few clicks! Pretty cool!
Any Other Interesting Actions?
Of course! For me, I think the dataset refresh and add a row to a dataset actions are the most helpful. They have specific uses and are not for everyone. But they have served me well in the past for certain edge cases or challenges that I am trying to solve.
In addition to those, there is a full complement of actions and triggers for goals. I find not a lot of organizations are leveraging goals, so they ignore these actions. Especially since they are officially in “preview” status as of the writing of this article. However, you might find a solid use case for them.
Power Automate Inside Power BI
Alright – we finally arrived at the moment you have been waiting for. How do I leverage Power Automate inside of Power BI? Well, it is quite simple. Just start by adding the Power Automate visualization to your report canvas like so:

From there, the steps are spelled out for you. Make sure you have the right environment selected, then start adding data. Once that is complete, you can click on the three dots and edit your flow:

Now there are a few things to note. First is that you have to use the classic editor for this. I do not have a solid answer to why this is the case, but it is just the reality of the situation. While the interface is not as nice, the same principals apply.
Next, you will note that I have a data operation step. This is to simply extract the data I care about and strip away the additional metadata from the JSON body that comes in. I am then able to take that body and do whatever I want with it. As a simple example, I am exporting it to a CSV file inside of my OneDrive.
Once I am finished with my customization of the flow, I can save and apply. And while I like the Power Automate blue, it does not match my theme. So, I can just make a quick adjustment to the fill color so it matches. I also update the button text to identify what will happen when I click it. This way everyone knows what it will do when you press it:

Once again, I am hearing some grumbling from people reading this article. Yes, I am with you that exporting to Excel or CSV from a Power BI report is not what we want our consumers to do. However, there are valid use cases for this type of process.
I had a customer recently that would export data from a legacy system into an Excel file so it could be ingested into their ERP solution. Now I think we would both agree, if you are using Power Automate, why not write a real integration? 100% agree with you on that. However, remember what I said about leveraging your existing investments?
This customer created this custom ingestion method almost ten years ago. And while it is probably time for an upgrade, someone was able to create this solution with about three hours of their time. The time savings to the user was minimal as it might have taken as much as ten minutes once every few days to do this process the old way. But likely not enough to justify rebuilding the process to create a new integration. So, while it was ugly, it got the job done while providing a quick return on investment.
Conclusion
These are only some small ideas of what you can accomplish with Power Automate within Power BI. You are only limited by your own imagination. Spend some time thinking about what you might be able to do with this solution as this could really extend the value you are creating within Power BI!
Also, if you are looking to learn more about how to use Power Automate, check out my friend Micheal Heath’s Get Automating YouTube channel. You can also check out more resources from Microsoft Learn as you start your automation journey!