Unlock Data Insights with Power Automate and Power BI Integration

25 July 2023

Two potent Microsoft technologies, Power BI and Power Automate, have the potential to completely change how businesses approach data analysis, reporting, and workflow automation. When Power Automate and Power BI are integrated, the possibilities are endless Together, these tools form a powerful team that improves business intelligence, expedites the decision-making process, and maximizes overall productivity.

In this blog, we'll explore how Power BI and Power Automate combine to speed up data processing and automate activities in this article.

Integration of Power BI and Power Automate

Organisations can maximise productivity and unlock the full potential of their data when Power BI and Power Automate are linked. How does this integration function?

  1. Automated Data Refresh: With Power Automate, users can schedule automatic data refreshes in Power BI. This ensures that reports and dashboards always display the most up-to-date information, eliminating the need for manual data updates.
  2. Data-Driven Alerts: Power Automate can be used to monitor data in Power BI and trigger alerts or notifications based on predefined conditions. For instance, if sales fall below a certain threshold, relevant stakeholders can be notified immediately, enabling timely interventions.
  3. Workflow Automation: Power BI insights can initiate workflows in Power Automate. For example, if a report identifies a potential issue, a workflow can be triggered to assign tasks to the appropriate team members and escalate critical matters to higher management.
  4. Export and Distribution: Power Automate can automate the process of exporting Power BI reports and distributing them via email or other communication channels to stakeholders, ensuring seamless information dissemination.
  5. Data Collection and Transformation: Power Automate can collect data from various sources and transform it before loading it into Power BI datasets. This capability streamlines the data preparation process and ensures that data is presented accurately.

Though Power Automate has a lot of triggers and actions which can be used with Power BI we will understand below actions:

  1. Refresh a Power BI Dataset.
  2. Query a Power Bi Dataset
  3. Export a Power BI report in pdf and email.

We have a sales report published in a sales workspace and the data source is an online SharePoint library. The report will be used to demonstrate the below actions in Power Automate.

 

 

Power BI and Power Automate Integration

Refresh a Power BI Dataset

Refreshing a dataset in Power BI using Power Automate (previously known as Microsoft Flow) can be achieved by creating a flow that triggers the dataset refresh at a defined interval or upon a specific event. This integration ensures that your Power BI reports and dashboards always display the most up-to-date data without manual intervention. Here's how you can set up the refresh process using Power Automate:

Prerequisites:

You need to have a Power BI Pro or Premium account to create a dataset refresh in Power BI.

Step-by-Step Guide:

Create a Power Automate Flow:

 

  • Click on the "Create" button, then select "Scheduled Cloud Flow." Power BI and Power Automate

 

  • Choose a Trigger. Search and select "Recurrence" as the trigger. This trigger allows you to set a schedule for dataset refresh. Set the Recurrence Schedule. Configure the recurrence schedule according to your requirements. You can choose a specific time of day and the frequency of refreshes (e.g., daily, hourly, weekly). Power BI and Power Automate

 

  • Add an Action. Search for and select "Power BI" as the action service. Choose "Refresh a dataset" as the action. Sign in to Power BI. If prompted, sign in with the same Power BI account that has access to the dataset you want to refresh.PowerBI and Power Automate

 

  • Select the Workspace and Dataset. Choose the appropriate workspace where the dataset is located. Select the dataset you want to refresh.Power BI and Power Automate Power BI and Power Automate

 

 

  • Save and Test the Flow: PowerBI and Power Automate

 

  • Before clicking on Test to manually trigger the flow, let's see the dataset's last refresh time:PowerBI and Power Automate

 

 

  • Go back to the Power BI Workspace to check whether the dataset refreshed:Power BI and Power Automate Integration

 

  • Our Dataset has been refreshed successfully.

Considerations

  • Dataset refresh in Power BI is subject to limitations based on your Power BI license type (Pro or Premium) and the dataset's data source. For example, some data sources may have refresh frequency limitations or require a direct connection. (8 Refresh in Power BI Pro and 48 Refresh in Power BI Premium)
  • Make sure the account used to create the flow has sufficient permissions to refresh the dataset in Power BI and access the data source.
  • Make sure the dataset is configured with the gateway (On-premises) and authenticated with credentials (Online).

By automating the dataset refresh process using Power Automate, you ensure that your Power BI reports are always up-to-date, providing accurate insights to users without manual intervention. This integration saves time, ensures data accuracy, and empowers better decision-making for your organisation.

Query a Power BI Dataset and send an email

Power BI datasets have a wealth of valuable data that can be used in Power Automate flows. Let’s look at how to retrieve data from a Power BI dataset and email it to a recipient.

Create a Power Automate Flow:

  • Go to the Power Automate website (https://flow.microsoft.com) and sign in with your Microsoft account.PowerBI and Power Automate Integration

 

  • Click on the "Create" button, then select "Scheduled Cloud Flow."PowerBI and Power Automate Inegration
  • Choose a Trigger. Search and select "Recurrence" as the trigger. This trigger allows you to set a schedule for dataset refresh. Set the Recurrence Schedule. Configure the recurrence schedule according to your requirements. You can choose a specific time of day and the frequency of refreshes (e.g., daily, hourly, weekly).

 

  • Add an Action. Search for and select "Power BI" as the action service.PowerBI and Power Automate

 

  • Search the “Run a query against dataset” action in Power BI and click on it.PowerBI and Power Automate

 

  • Select your workspace and dataset. We need to provide a query text here to explain the data schema for querying.PowerBI and Power Automate

 

  • In order to get a query, open your report in Power Bi Desktop and create a table visual with all the columns required as follows:PowerBI and Power Automate Integration

 

  • Click on the table and go to the optimize tab. Open the performance analyser and click on start recording.PowerBI and Power Automate

 

  • Click on refresh visuals and you will see the time taken by Dax query, visual display and others. Click on copy query.PowerBI and Power Automate

 

  • Once the query is copied, go to MS Flow and paste the query in the query text column.PowerBI and Power Automate Integration

 

  • Click on add action and search “Create a Html table”. This will create a HTML table of the data which can be sent in the body of the email.PowerBI and Power Automate Integration

 

  • Pass the output of the previous action (First Table rows) to the From column.PowerBI and Power Automate Integration

 

  • Now the table is created, let's add an action to send an email to the user. Search Send an email actionPowerBI and Power Automate Integration

 

  • Enter the recipient's email address, subject and provide the output of the previous action in the body:Power BI and Power Automate Integration

 

  • Click on save and test to run the flow manually.PowerBI and Power Automate 27

 

 

  • Once the flow runs successfully, go to your Outlook and check the email received from MS Flow.PowerBI and Power Automate Integration

 

  • An email was triggered with all the details configured from the Power BI Dataset.

In order to query a dataset, we can write this custom query to include more columns and filters. Apart from sending emails to the users, the dataset can also be exported to shared locations like SharePoint or One drive.

Export a Power BI Report in pdf and send it via email.

A common workflow with business users consuming Power BI reports is to export the report in PDF/PPT format and send it to stakeholders. This workflow can be automated using MS Flow, let's understand the step-by-step implementation of it:

Create a Power Automate Flow:

 

  • Click on the "Create" button, then select "Scheduled Cloud Flow."PowerBI and Power Automate Integration

 

  • Choose a Trigger. Search and select "Recurrence" as the trigger. This trigger allows you to set a schedule for dataset refresh. Set the Recurrence Schedule. Configure the recurrence schedule according to your requirements. You can choose a specific time of day and the frequency of refreshes(e.g., daily, hourly, weekly).
  • PowerBI and Power Automate Integration

 

  • Go to Power BI actions and select “Export to file for Power BI reports”Power BI and Power Automate Integration

 

  • Enter Workspace, Report, Report format(Pdf/ppt) and other details. User can also provide the bookmark name or RLS-related details to limit the visuals on the export.Power BI and Power Automate Integration

 

  • In order to send emails to users with attachments, go to “Send an email” Action. Enter the mail recipients name, subject and body of the email. Make sure the attachment name ends with the format name (.pdf,.ppt). Add previous action File Content to the Attachment section.Power BI and Power Automate Integration

 

  • Click on save and run the flow. It will trigger an email to the users with a pdf version of the report.Power BI and Power Automate Integration

 

Considerations

  • This action will work only when the report is shared in a premium capacity workspace. If you have a pro license and the workspace is not premium, you might get the below error: Power BI and Power Automate Integration

 

In addition to the above 3 actions, there are many triggers and actions available in Power Automate for Power BI as follows:

Triggers:Power BI and Power Automate Integration

 

ActionsPower BI and Power Automate Integration

 

Best Practices for Successful Integration

Data Security and Compliance

Ensure that sensitive data is handled securely, adhering to data protection regulations and internal policies. Use encryption, role-based access controls, and data loss prevention measures to safeguard data integrity.

Test and Monitor Workflows

Thoroughly test all workflows before deployment to identify and fix any issues. Regularly monitor automated processes to ensure they are functioning correctly and making accurate decisions.

Conclusion

The integration between Power BI and Power Automate provides organisations with a powerful toolset to unlock the full potential of their data and automate business processes. By leveraging real-time insights and streamlining workflows, businesses can make informed decisions, improve efficiency, and stay ahead in today's data-driven world. By following best practices and exploring various integration scenarios, organizations can unleash the true potential of Power BI and Power Automate to achieve remarkable outcomes.

Vidi-Corp is a Power BI Consultant and we offer bespoke Power BI training for data-driven businesses. Contact us now to discuss how we can empower you and your team.

Microsoft Power Platform

Everything you Need to Know

Of the endless possible ways to try and maximise the value of your data, only one is the very best. We’ll show you exactly what it looks like.

To discuss your project and the many ways we can help bring your data to life please contact:

Call

+44 7846 623693

eugene.lebedev@vidi-corp.com

Or complete the form below