Using Microsoft Flow in a Power BI Data File Process
This blog post explains, at a very high level, how to process a file delivered via email into a Power BI report using Microsoft Flow. The post assumes prior knowledge of Power BI Desktop and will only describe the steps needed to incorporate the file into the Power BI Query Editor.
Let’s get started.
The best practice is to have the file sent to a dedicated, non-expiring email address. Once this is established, the following steps outline how to set up a flow that watches for delivery of the email with the attached file.
Start off by logging into flow.microsoft.com with a valid login. You will be directed to the home page. In the search box, type: “Save email attachment to SharePoint” and hit the search icon:
From here, you’ll be taken to a screen that lists preexisting flow-templates for saving a file to SharePoint. Select the first flow, as shown below:
The following screen will appear. Click “Continue” at the bottom of the screen:
Enter the email To and From info in the ‘On new email with attachment’ box:
Set up the condition to check ‘Attachment Name’ for specific characters in the file name:
In the ‘If yes’ container, enter the SharePoint information in the ‘Copy File’ Action box. At this point, I removed all objects in the ‘If no’ container, but feel free to add logic in this container, if desired:
Click ‘Save’ and test the flow to ensure the file has been delivered to the correct SharePoint folder for Power BI processing:
Open Power BI Desktop and click ‘Edit Queries’. Once in the Power Query Editor, select SharePoint folder from ‘New Source’:
Enter a valid SharePoint address:
Filter on the file name that you want to process in the report:
From this point, you can edit the file in the query editor, develop the data model and report in the Power BI desktop, publish the report to the Power BI service, and schedule the report to run on a timely schedule. Lastly, if your organization needs more help with any aspect of Microsoft Flow, please don’t hesitate to reach out to us. We’d love to help you get started.