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 v-sgandrathi ,
Thank you for your response.
Hi Raki39,
Thank you for your follow-up and for clearly outlining your requirement.
You are correct in your understanding that the current behavior is expected. When a Power Automate flow is triggered from Power BI, it executes using the flow owner’s connection, which means actions like creating files in OneDrive or SharePoint will always target the flow owner’s storage. At this time, Power Automate does not support dynamically switching the connection context to the user who triggered the report, so creating files directly in each user’s personal OneDrive is not feasible using this approach.
Considering your scenario, where the report is embedded within a web portal and requires user-specific file generation and storage, your plan to use Angular and .NET along with Power BI REST APIs is appropriate. This approach allows you to manage user context at the application level and ensures that the generated file can be delivered or stored based on the logged-in user. You can retrieve the required data using Power BI REST APIs, generate the Excel file programmatically, and then either allow the user to download it directly or store it in their respective location using Microsoft Graph.
This design provides greater flexibility, better performance, and aligns well with scenarios that require per-user ownership and a seamless user experience
Thank you.