Power Automate: export a Power BI visualization to excel

This article will explain how to export the data from a Power BI “visualization” (red section) into an excel file:

power bi

If you are looking more to export the data from “data” (green section), read Connect to Power BI in an excel report

NOTE: Power BI should be uploaded in the cloud (Power BI Service)

In my Power BI Desktop, I have those 2 visualizations, a table and a pie chart:

power bi

NOTE: with any types of visualization, the result/process will be the same

Click on “view -> performance analyzer”:

power bi

Click on “start recording”:

power bi

Click on “refresh visuals”:

power bi

A list of visualizations will appear:

power bi

NOTE:

  • Using “clear” and “refresh visuals” every time I change something (add new one, modify title, etc.) for a cleaner list
  • If I put a title for my visualizations, the name will appear:
    power bi

Click on “+” to expand more option then click on “copy query”:

power bi

On Power Automate, click on “create” and select the flow type. For my example, I will select “instant cloud flow”:

power bi

Put a title and select “manually trigger a flow”:

power bi

Click on the “+” then in the “add an action” field, put “power bi run a query” to select this option:

power bi

Fill up all fields:

  • Workspace: the name of the workspace
  • Dataset: the name of my Power BI
  • Query text: just paste what I copied from my Power BI Desktop
power bi

Click on the “+” again then put “create csv table” to select the option with the same name:

power bi

NOTE:

  • Alternatively, I can select “create HTML table”, useful if I don’t want to put the result in an excel but in the body of an email for instance
    power bi
  • For both, the process is the same

Click on the “from” field then in the lightning icon:

power bi

Select this option:

power bi
power bi

From now, I have different options, I will explain how to receive it by email (option 1) and how to have it in the sharepoint (option 2).

Option 1 - email

power bi

Click on the “+” again then put “send email” to select this option:

power bi

Click on “advanced parameters” to select this option:

power bi

Click on “add new item”

power bi
  • In “name”: put a name including the “csv” extension
  • In “content”: click on the lightning icon to select:
    power bi
power bi

NOTE: if I have used “create HTML table”, I can put the “output” in the “body” field. To customize the body, read Power Automate: email in html (table, link, image, etc.)

power bi

Option 2 - sharepoint

power bi

Click on the “+” again then put “sharepoint create file” to select this option:

power bi

Fill up all fields:

  • In “site address”: my sharepoint
  • In “folder path”: my sharepoint folder
  • In “file content”: click on the lightning icon to select:
    power bi
  • In “file name”:
    • For a single time extraction, put a name including the “csv” extension
      power bi
    • For a recurrent exportation and to avoid overwriting, I will include the date in the name. For that, instead to click on the lightning icon, click on the fx icon
      power bi
      Put this code then click on “add”:
      concat('yournamefile_',formatDateTime(utcNow(),'ddMMyy'),'.csv')
      power bi
      NOTE: change yournamefile by yours
      power bi

Interesting Topics