Forum Discussion
Trigger Power Automate from Power BI report button to export report data to Excel (with formatting)
- 5 months ago
Hi Raki39,
This is the expected behavior. When a Power Automate flow is triggered from Power BI, it uses the flow owner's connections rather than the user's identity who triggered it. As a result, actions like Create file in OneDrive will always write to the OneDrive linked to the flow owner, so files are created in your OneDrive even if other users run the report.
Currently, Power Automate does not allow the OneDrive or SharePoint connection to switch dynamically based on the triggering user. This means the flow cannot create files in each user's personal OneDrive when using a shared flow.
To address this, a common solution is to store the generated file in a central SharePoint document library and provide access to the user who triggered the export. You can identify the user (for example, using Power BI visual context or user information passed to the flow) and then share the file link or send it automatically. This lets each user access their exported data without relying on the flow owner's OneDrive.
This approach keeps the storage location consistent while enabling users to retrieve their exported files from the report.
Thank you and Contiue using Microsoft Fabric Community Forum.
Hi Raki39,
Thank you Juan-Power-bi for sharing the tutorial here.
Yes, you can trigger a Power Automate flow from a Power BI report, but this can't be done with a standard button visual. Instead, you should use the Power Automate visual in Power BI, which lets users run a flow directly from the report in Power BI Service. When setting up the visual, you can pass specific dataset fields to the flow. Once the report is published, users choose the relevant data context and click Run Flow to start the process.
To export data to Excel, pass the necessary fields from the Power BI visual to Power Automate. Within the flow, use actions like Create CSV table or Add a row into a table (Excel Online Business) to organize the data, and then Create file to generate the Excel file. This file can be saved to a SharePoint or OneDrive location linked to the flow. Note that while data structure is preserved, visual formatting from Power BI isn't automatically applied in Excel, so you might need an Excel template for formatting.
Saving the file directly to each user’s personal OneDrive is challenging, as flows typically run under the flow owner’s connection and save files to a set location. A common solution is to store the file in a shared SharePoint folder and send users a link by email. If you need to export a full report with layout and formatting, consider using Paginated Reports, which support native exports to Excel and other formats.
Thank you and Continue using Microsoft Fabric Community Forum.