How to Automate Power BI Reports

26 February 2025

Want to automate Power BI reports in your organization? Focus on the following areas:

  • Automate data extraction
  • Automate data transformation
  • Automate data refresh
  • Automate the distribution of Power BI reports

We have previously written an article about automating data extraction and transformation in Power BI. This article will focus on automating data refresh and distribution of Power BI reports.

There are several methods to automate Power BI reports: using Power BI Service, Power Automate, XMLA endpoints, and REST API. We will dive into practical use cases and step-by-step guides for implementing these automation techniques.

Whether you’re a business analyst, data engineer, or IT professional, this comprehensive guide will equip you with the knowledge and tools needed to enhance your Power BI reporting capabilities through automation.

Automate Power BI Dataset Refresh

Scheduling data refreshes is fundamental to keeping your Power BI reports updated with the latest information. There are two primary ways to automate the refresh of Power BI reports:

  1. Using Power BI Service
  2. Using Power Automate

Using Power BI Service

The Power BI Service provides a straightforward method to schedule data refreshes for your reports. This approach is ideal for users who want to automate the refresh process without additional integrations.

Ensure your dataset is published to the Power BI Service. In the Power BI Service, go to the workspace containing your dataset, and click on settings:

Power BI Sales Reporting

Make sure the data source credentials are configured correctly to allow scheduled refresh. Under the Scheduled refresh section, toggle the Keep your data up to date option to On. Specify the refresh frequency (daily, weekly, etc.) and the time when the refresh should occur. Save the settings to apply the scheduled refresh.

Sales reporting in Power bi

Using Power Automate

Power Automate (formerly Microsoft Flow) allows you to create automated workflows that can include refreshing Power BI datasets as part of a broader automation process. We can schedule the refresh of Power BI reports using Power Automate. Here’s the process to configure it:

Open Power Automate and click on Create a Flow. Choose Scheduled Cloud Flow, then set the desired time for the flow to run (daily, weekly, or monthly) and click Create.

Power Automate

After the flow is created, add an action by selecting Power BI and searching for the Refresh a Dataset action. Choose the workspace and semantic model you want to refresh, then click Save.

Power BI Dashboard

Power BI has some limitations when it comes to scheduled refresh, particularly for datasets that are hosted on Power BI Service. Here are the key limitations:

Refresh Frequency:

  • Pro License: A dataset can be scheduled to refresh up to 8 times per day.
  • Premium License: A dataset can be scheduled to refresh up to 48 times per day (every 30 minutes).
See also  How to Connect Xero to Power BI

Data Size:

  • Pro License: The maximum dataset size for a Power BI dataset is 1 GB.
  • Premium License: The maximum dataset size can be up to 400 GB, depending on the capacity.

Power BI Automated Export to PDF

Exporting a Power BI report into PDF or other formats is a common business requirement. This process can be automated using Power Automate, allowing business users to receive a Power BI report in PDF format in their Outlook inbox at a specific time each day. Let’s understand the steps to configure a flow to implement this

Open Power Automate and click on Create a Flow. Choose Scheduled Cloud Flow, then set the desired time for the flow to run (daily, weekly, or monthly) and click Create.

Power BI Automated Export to PDF

In the flow designer, click on New Step, search for Power BI, and select the Export to File for Power BI Reports action. Choose the workspace and report you want to export. Select PDF as the export format. Optionally, you can specify specific pages or bookmarks to include in the export.

Export to file for power bi reports

Click on New Step, search for Send an email, and select the appropriate email action (e.g., Send an email (V2) for Outlook). Provide details in To, Subject and Body. Add previous step output to the attachment input as follows:

Sales and Marketing updates

By following these steps, you can automate the process of exporting Power BI reports to PDF and sending them via email, ensuring that your stakeholders always have access to the latest data insights without the need for manual intervention.

Other Uses of Power Automate in Power BI

In addition to refreshing datasets and exporting Power BI reports to PDF, there are several other tasks that can be automated using Power Automate. You can read more about them in our Power Automate Power BI Integration article. For now will briefly mention them below:

1. Add Rows to a Dataset

Action: This action allows you to add new rows to an existing Power BI dataset. It is useful for dynamically updating your dataset with new data in real-time.

Use Case: For instance, if you have a dataset tracking sales data, you can use this action to add new sales records as they occur, ensuring your report reflects the latest information.

2. Export to File for Paginated Reports

Action: This action enables you to export a Power BI paginated report to a specific file format, such as PDF or Excel.

Use Case: For instance, you can schedule a flow to automatically export monthly financial reports to PDF and distribute them to stakeholders via email.

3. Get a Goal

Action: This action retrieves detailed information about a specific goal in Power BI. It provides insights into the current status, progress, and other key details of the goal.

Use Case: Use this action to monitor the status of business objectives, enabling you to make informed decisions based on the latest goal updates.

4. Run a JSON Query Against a Dataset

Action: This action allows you to execute a JSON query against a Power BI dataset.

Use Case: Use this action to perform specific data queries and retrieve results in JSON format, which can then be used in further actions or analyses.

5. Run a Query Against a Dataset

Action: This action allows you to execute a query against a Power BI dataset.

Use Case: Use this action to run customized queries to extract specific data from a dataset, which can be useful for generating tailored reports or analyses.

See also  How to Build Power BI Sales Dashboards with Examples

6. Get Multiple Goals

Action: This action retrieves information about multiple goals in Power BI.

Use Case: Use this action to gather details about several goals at once, which can help in comparing progress and performance across different objectives within your organization.

7. Get Scorecards

Action: This action retrieves information about scorecards in Power BI.

Use Case: Use this action to access details about scorecards, which are collections of goals and KPIs, providing a holistic view of performance across various metrics

8. Update a Check-In

Action: This action allows you to update an existing check-in for a goal in Power BI.

Use Case: Use this action to modify the details of a check-in, such as progress or status updates, ensuring that the information remains accurate and up-to-date.

9. Update a Goal

Action: This action allows you to update an existing goal in Power BI.

Use Case: Use this action to modify the details of a goal, such as its target or description

Power BI Action
Power bi - add an action

Power BI Automated Email Reports

In case you are wondering whether Power BI can send automated emails without the use of Power Automate, the answer is yes! There are 2 useful Power BI features that help with this task.

Subscriptions

The subscriptions feature in Power BI allows users to receive report updates directly in their email inbox at specified intervals. This feature ensures that stakeholders are consistently informed about the latest data insights without manually checking the reports. Let’s understand how to set up subscriptions:

Navigate to the Power BI service and open the report or dashboard you want to subscribe to. Click on the Subscribe button (bell icon) at the top of the report or dashboard.

Power bi sales report dashboard

Enter a name for the subscription. Add the email addresses of the recipients who should receive the report updates. Set the frequency of the subscription (e.g., daily, weekly, monthly) and specify the time when the report should be sent. Optionally, add a custom message to include in the email. Click Save and close to activate the subscription.

Subscriptions

Once the subscription is set up, the recipients will receive email updates with the latest version of the report or dashboard according to the specified schedule.

Data Alerts

Data alerts in Power BI allow users to set up notifications that are triggered when data in a report or dashboard reaches a specific threshold or condition. This feature is useful for monitoring key metrics and receiving timely alerts about important changes in the data. Let’s explore how to set up data alerts.:

Navigate to the Power BI service and open the report or dashboard containing the visual you want to monitor. Click on the visual that you want to set an alert for. Click on the … (more options) menu on the visual, and select Manage alerts.

Sales report

Define the condition that will trigger the alert (e.g., when a value exceeds a certain threshold).Set how often you want to be notified (e.g., once an hour, once a day). Specify the email addresses of the recipients who should receive the alert notifications. Click Save and close to activate the alert.

Sales alert

Once the data alert is set up, Power BI will monitor the specified visual and send email notifications to the recipients when the alert condition is met.

See also  Top 10 Power BI Consultancies in 2024

Automating Power BI Reports with REST API or XMLA Endpoints

Automating Power BI reports using XMLA and REST API endpoints can significantly enhance your reporting capabilities, ensuring that your reports are always up-to-date and accessible. These methods provide powerful ways to interact with Power BI datasets, automate tasks, and integrate with other systems. Let’s explore how to use XMLA and REST API endpoints to automate Power BI reports.

Automating Reports with XMLA Endpoints

XMLA (XML for Analysis) endpoints allow you to interact with Power BI datasets using the same protocol as SQL Server Analysis Services (SSAS). This method is ideal for large-scale data operations and provides a robust way to manage and query datasets.

Steps to Use XMLA Endpoints:

  1. Enable XMLA Endpoints: Ensure that your Power BI workspace is in a Premium capacity, as XMLA endpoints are only available in Power BI Premium. Go to the Power BI Admin Portal and enable XMLA read/write endpoints for your workspace.
  2. Connect to XMLA Endpoint: Use a client tool like SQL Server Management Studio (SSMS) or any other Analysis Services client to connect to the XMLA endpoint. The connection string will be in the format:

powerbi://api.powerbi.com/v1.0/myorg/{workspaceName}.

  1. Perform Data Operations: Once connected, you can perform various data operations such as querying datasets, refreshing data, and managing metadata. You can use MDX (Multidimensional Expressions) or DAX (Data Analysis Expressions) queries to interact with the data.
  2. Automate with Scripts: Write scripts to automate data operations. For example, you can use PowerShell scripts to refresh datasets or update data models. Schedule these scripts to run at specific intervals using task schedulers or automation tools.

XMLA is particularly useful when you need to refresh a specific table within a semantic model instead of the entire model. You can use the following TMSL script to refresh your table via XMLA:

{

“refresh”: {

“type”: “full”,

“objects”: [

{

“database”: “DB Name”,

“table”: “Table Name”

}

]

}

}

Note: XMLA operations are supported exclusively in either Premium or Fabric workspaces.

Power BI REST API Endpoints

The Power BI REST API provides a programmatic way to interact with Power BI resources, allowing you to automate tasks such as updating datasets, modifying reports, and managing access to workspaces.

Use the Power BI REST API endpoints to perform various tasks. Some common actions include:

Let’s say if someone needs to retrieve a list of all reports in a workspace, they can use the following PowerShell script with the Power BI REST API:

$headers = @{

Authorization = “Bearer $accessToken”

}

$apiUrl = “https://api.powerbi.com/v1.0/myorg/groups/$workspaceId/reports”

$response = Invoke-RestMethod -Method Get -Uri $apiUrl -Headers $headers

# Output the list of reports

$response.value | Select-Object -Property id, name

You can refer the documentation and all end points for Power BI Rest API here:

Power BI REST APIs for embedded analytics and automation – Power BI REST API | Microsoft Learn

Conclusion

Automating Power BI reports offers numerous advantages for businesses, enabling them to stay ahead in today’s fast-paced and data-driven environment.

By implementing automation techniques such as scheduled refreshes, Power Automate workflows, XMLA endpoints, and REST API integrations, organizations can ensure that their reports are always up-to-date with the latest data.

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