Forum Discussion
Send Power BI report as excel via email using Power Automate
- 1 year ago
Ahh Sorry I didn't notice you wanted it as an attachment.
Use HTML to embedd the table in the body of the email.
Use CSV to send as an attachment that will open in Excel.
When you are happy it works, change your trigger from manual to Power BI when button is clicked 🙂
Hi POSPOS
I want this data stored outside of Power BI.
First thing to do is go to View | Performance analyzer and toggle this on.
When you click Performance analyzer a new pane will appear on the right.
This will show you how long each of your visuals takes to load, click on Refresh visuals button.
When you click, all visuals will appear beneath.
Click on the + icon and choose Copy Query to add the DAX code to your clipboard.
We now have the code Power BI uses to generate the visual.
Now to extract the data you want, swap to Power Automate in your browser.
Create a new flow by clicking on New flow | Instant cloud flow.
You can choose from several triggers but here we choose Instant cloud flow.
Give your flow a suitable name and choose Manually trigger a flow to create your new flow.
Manually triggered flows run when you choose but there are other options.
This will open up your designer where you choose all the steps of the flow. Click on the + to add a new step.
Choose Add an action
This will list out all the actions we have to choose from. Search for Run a query against a dataset and you should see Power BI.
We want to run the query copied earlier.
Select the Workspace and Dataset of your published report, then paste the code from your clipboard into Query Text.
Power Automate will create the table we saw in our report.
Now in the top right choose Save and then click on Test to run your flow.
You must save before selecting the Test option.
If you have run this flow before, you can choose Automatically to re-run with previous data.
For now choose Manually and select Test to try your new flow.
You can run the flow by clicking Test.
We should now see each step with a tick next to it. You can now select the Power BI step to see the returned data.
Click on the last step to see more information.
Each step has an Inputs and Outputs section and by choosing Show raw outputs we can see our data.
Clicking here will show you a JSON file of the returned information.
Now you can see all the returned data in the body section of the output.
The headers section includes useful information like run Date.
From here you could email this data or store it somewhere like a SharePoint list!
I imagine you will want to choose Create HTML table and then add the Output of the HTML table to the body of your email.