VERSICH

Integrating Power Automate with Power BI for Enhanced Workflow

integrating power automate with power bi for enhanced workflow

Two powerful Microsoft tools, Power BI and Power Automate, can revolutionize how businesses handle data analysis, reporting, and workflow automation. By integrating Power Automate and Power BI, organizations can explore infinite possibilities. Together, these tools create a dynamic duo that enhances business intelligence, shortens decision-making time, and increases overall productivity.

In this article, we’ll look at how Power BI and Power Automate work together to expedite data processing and automate repetitive tasks. We frequently apply these strategies in our Power BI consulting and Power Automate consulting projects, and we strongly encourage you to adopt them in your business as well!

Integration of Power BI and Power Automate

When linked, organizations can optimize productivity and fully harness the potential of their data through the integration of Power BI and Power Automate. So, how does this integration work?

Automated Data Refresh

With Power Automate, users can schedule automatic data updates in Power Automate for Power BI. This guarantees that reports and dashboards consistently reflect the latest information, negating the need for manual data updates.

Data-Driven Alerts

Power Automate can monitor data in Power BI and initiate alerts or notifications based on set conditions. For example, stakeholders can be notified instantly if sales dip below a certain level, enabling quick responses.

Workflow Automation

Insights from Power BI can trigger workflows in Power Automate. For instance, when a report spots a potential issue, it can activate a workflow that assigns tasks to appropriate team members and escalates urgent matters to management.

Export and Distribution

Power Automate can automate the export of Power BI reports and their distribution via email or other communication methods, ensuring smooth information flow.

Data Collection and Transformation

Power Automate can gather data from various sources, transform it as needed, and then load it into Power BI datasets. This functionality streamlines the data prep process and presents data accurately.

While Power Automate offers numerous triggers and actions compatible with Power BI, let’s delve into the specific actions discussed below:

  1. Refresh a Power BI Dataset.

  2. Query a Power BI Dataset.

  3. Export a Power BI report in PDF and email it.

Refresh a Power BI Dataset

To refresh a dataset in Power BI using Power Automate (previously known as Microsoft Flow), you can set up a flow that triggers the dataset refresh at a specified time or upon an event. This integration ensures that your Power BI reports and dashboards reflect the most current data without requiring manual updates. Here’s how to establish the refresh process with Power Automate:

Prerequisites:

A Power BI Pro or Premium account is necessary to create a dataset refresh in Power BI.

Step-by-Step Guide:

Create a Power Automate Flow:

  1. Visit the Power Automate website (https://flow.microsoft.com) and log in with your Microsoft account.

  2. Click on the “Create” button, and then choose “Scheduled Cloud Flow.”

  3. Select a Trigger. Search for and choose “Recurrence” as the trigger. This allows you to schedule the dataset refresh.

  4. Set the Recurrence Schedule. Configure it to your liking, selecting a specific time of day and how often you want the refresh (e.g., daily, hourly, weekly).

  5. Add an Action. Find and select “Power BI” as the action. Pick “Refresh a dataset” as the action.

  6. Sign in to Power BI. If prompted, log in with the same Power BI account that has access to the dataset you wish to refresh.

  7. Select the Workspace and Dataset. Choose your workspace and the dataset you want to refresh.

  8. Save and Test the Flow.

Before initiating the test manually, check the dataset’s last refresh time by going back to the Power BI Workspace to ensure the dataset has been refreshed successfully.

Considerations

Dataset refresh timing in Power BI depends on your Power BI license type (Pro or Premium) and the dataset's source. Some sources may have limitations on refresh frequency or require direct connections. (8 Refreshes for Power BI Pro and 48 for Power BI Premium) Ensure the account used to set up the flow has the necessary permissions to refresh the dataset in Power BI and access its source. The dataset must also be configured with the proper gateway (On-premises) and authenticated with the right credentials (Online).

By automating the dataset refresh process through Power Automate, you ensure that your Power BI reports are perpetually up-to-date, delivering accurate insights to users effortlessly. This integration saves time, enhances data accuracy, and supports better decision-making for your organization.

Query a Power BI Dataset and send an email

Power BI datasets contain a wealth of important data that can be utilized within Power Automate flows. Let’s examine how to extract data from a Power BI dataset and email it to a specified recipient.

Create a Power Automate Flow:

  1. Head to the Power Automate website (https://flow.microsoft.com) and log in with your Microsoft account.

  2. Click “Create,” then select “Scheduled Cloud Flow.”

  3. Choose a Trigger. Search for and select “Recurrence” as the trigger, allowing you to schedule dataset refresh.

  4. Set the Recurrence Schedule. Adjust this according to your needs, choosing a specific time and refresh frequency (e.g., daily, hourly, weekly).

  5. Add an Action. Find and select “Power BI.”

  6. Choose the “Run a query against dataset” action in Power BI and click on it.

  7. Select your workspace and dataset. Here, insert your query text to clarify the data structure for querying.

To obtain a query, utilize Power BI Desktop to create a table visual encompassing all required columns:

  • Click the table, navigate to the optimize tab, and select the performance analyzer.

  • Start Recording, and then click Refresh Visuals. Note the time taken by the DAX query. Click Copy Query.

After copying the query, return to Power Automate and paste it in the query text field.

  1. Click on Add Action and search for “Create an HTML table.” It will format the data into an HTML table for inclusion in the email body.

  2. Pass the output from the previous action (First Table rows) to the From column.

Now that the table is ready, let’s finalize it with an action to send an email to the user. Search for the “Send an email” action.

  • Fill in the recipient’s email address and subject, and include the earlier action’s output in the email body. 10. Click Save and Test to run the flow manually.

Once the flow executes successfully, check your Outlook for the email sent from Power Automate.

An email should appear containing all the details extracted from the Power BI Dataset.

To query a dataset, you can craft a custom query to incorporate additional columns and filters. Besides emailing users, the dataset can also be exported to shared locations like SharePoint or OneDrive.

Export a Power BI Report in PDF and send it via email

A frequent task for business users is to export Power BI reports in PDF or PPT format and distribute them to stakeholders. This process can be automated using Power Automate. Let's review the step-by-step approach for this:

Create a Power Automate Flow:

  1. Access the Power Automate website (https://flow.microsoft.com) and log in with your Microsoft account.

  2. Click “Create” and then select “Scheduled Cloud Flow.”

  3. Select a Trigger. Search for and choose “Recurrence” as the trigger, allowing you to set a refresh schedule.

  4. Set the Recurrence Schedule. Modify this according to your needs, specifying a time of day and frequency of refresh (e.g., daily, hourly, weekly).

  5. Navigate to Power BI actions and select “Export to file for Power BI reports.”

  6. Input Workspace, Report, Report format (PDF/PPT), and additional information. This may include a bookmark name or RLS details to refine the returned visuals.

  7. To send emails to users with attachments, select the “Send an email” action. Enter the recipient's name, subject, and body of the email. Ensure the attachment name concludes with the format (.pdf, .ppt). Include the File Content from the previous action in the attachment section.

  8. Click Save and run the flow. This will trigger an email to users with a PDF version of the report attached.

Considerations

This action will only function if the report is located in a premium-capacity workspace. If you possess a Pro license and the workspace isn't premium, an error may occur.

Alongside the 3 actions highlighted, a myriad of triggers and actions are also available in Power Automate for Power BI as follows: 

Best Practices for Successful Integration

Data Security and Compliance

It’s essential to ensure that sensitive data is managed securely, in line with data protection laws and internal standards. Employ encryption, role-based access controls, and data loss prevention tactics to maintain data integrity.

Test and Monitor Workflows

Be sure to thoroughly test all workflows prior to deployment to identify and rectify any problems. Regularly observe automated procedures to verify they function correctly and make accurate decisions.

Conclusion

The connection between Power BI and Power Automate grants organizations a robust suite of tools to unlock their data's full capabilities and automate various business operations. By leveraging real-time insights and streamlining workflows, companies can make informed decisions, enhance efficiency, and maintain a competitive edge in today's data-driven landscape. By adhering to best practices and exploring diverse integration possibilities, organizations can fully realize the potential of Power BI and Power Automate for outstanding results.