How to Auto Publish Power BI
Manually updating and publishing your Power BI reports every day is a tedious process that eats up valuable time you could be spending on analysis. This guide will walk you through several methods to automate your Power BI publishing and data refreshes, from simple built-in scheduled refreshes to more advanced workflows. You'll learn how to set up your reports to update automatically, ensuring your team always has the most current data without any manual effort.
What Does "Auto Publishing" in Power BI Really Mean?
"Auto publishing" can mean a few different things depending on your goal, and it's helpful to clarify what you're trying to achieve. Most often, users are talking about one of three scenarios:
- Scheduled Data Refresh: This is the most common use case. You have a report published to the Power BI service, and you want the underlying dataset to refresh automatically on a set schedule (e.g., every morning at 8 AM). This keeps the visuals in your published report up-to-date with the latest data from your sources.
- Automated Distribution: This involves automatically sending a report or a notification to stakeholders after a data refresh. You might want to email a PDF of the report to your team or post a message in Microsoft Teams letting everyone know the sales dashboard is updated.
- Dynamically Publishing New Reports: A more advanced scenario involves programmatically creating and publishing new Power BI reports using code, often leveraging the Power BI REST API. This is less common for typical business users and more suited for developers creating custom analytics solutions.
For most users, the goal is a combination of the first two: keeping the data fresh and letting people know it's ready. Let's look at the most practical ways to accomplish this.
Method 1: Use Power BI's Built-In Scheduled Refresh
The simplest way to automate your Power BI data is by using the Scheduled Refresh feature directly within the Power BI Service. This tells Power BI to connect to your data sources at specific times and pull in the latest information. It's user-friendly and perfect for setting up daily or weekly updates.
Prerequisites You'll Need
Before you can set up a scheduled refresh, you need to make sure Power BI can actually access your data sources on its own. This involves two key things:
- Publish Your Report: You have to publish your report from Power BI Desktop to a workspace in the Power BI Service (app.powerbi.com).
- Data Source Credentials: Power BI needs to know how to log in to your data sources (like a SQL database, a SharePoint file, etc.). You'll need to provide these credentials in the Power BI Service.
- Gateway (for On-Premises Data): If your data source is on a local computer or a private server (not in the cloud), you must install and configure an On-Premises Data Gateway. This gateway acts as a secure bridge, allowing the Power BI cloud service to reach your local data. For cloud sources like Google Analytics, Salesforce, or Azure SQL database, you won't need a gateway.
Step-by-Step Guide to Setting Up Scheduled Refresh
Once you've published your report to the Power BI service, follow these steps to set up your refresh schedule.
1. Find Your Dataset
In the Power BI service, navigate to the workspace where you published your report. Find the dataset associated with your report. It will have the same name as your report and a different icon (often orange). Hover over it and click the three dots (...), then select Settings.
2. Configure Data Source Credentials
In the settings page, expand the Data source credentials section. You'll see an "Edit credentials" link for each data source in your report. You must enter your login credentials here and select an authentication method (e.g., Basic, OAuth2) for each one. This gives Power BI permission to access the data on your behalf.
If you're using an on-premises data source, you’ll also need to ensure your Gateway connection is listed and running correctly here.
3. Set the Refresh Schedule
Scroll down and expand the Scheduled refresh section. Toggle it to "On."
This is where you define how often your data will update:
- Refresh frequency: Choose between "Daily" and "Weekly."
- Time zone: Select your local time zone so the refreshes happen when you expect them to.
- Add another time: Click this to select the specific times of day you want the refresh to run. With a Power BI Pro license, you can schedule up to 8 refreshes per day. With a Premium license, up to 48.
For example, you could schedule your sales report to refresh every workday morning at 7:00 AM, ensuring the data is current before your team logs on.
4. Set Up Refresh Failure Notifications
Finally, check the box under Send refresh failure notifications to. By default, it will email you (the dataset owner) if a refresh fails. You can also add other emails, like a company data support group.
Click Apply, and you're all set! Power BI will now automatically refresh your dataset according to the schedule you defined.
Method 2: Create Custom Workflows with Power Automate
What if you want more flexibility than the built-in scheduler offers? Maybe you need to refresh a dataset only after a file has been uploaded to SharePoint, or you want to send a custom message to a Microsoft Teams channel after the refresh is complete. This is where Power Automate comes in.
Power Automate (part of the Microsoft Power Platform) allows you to create automated "flows" that connect different apps and services. It includes a robust connector for Power BI, enabling you to build powerful, custom automation scripts without writing any code.
Example: Refresh a Dataset and Notify Your Team on Teams
Let's walk through creating a flow that runs on a schedule, refreshes a Power BI dataset, and then posts a message to a team about the update.
1. Start a New Flow in Power Automate
Go to Power Automate (make.powerautomate.com). Click Create on the left-hand navigation bar and select Scheduled cloud flow.
Give your flow a name, like "Daily Sales Report Refresh & Notify." Set your desired schedule — for example, run every 1 day at 8:00 AM — and click Create.
2. Add the Power BI "Refresh a Dataset" Action
Every flow starts with a trigger. In this case, our trigger is the schedule we just set. Click + New step to add your first action.
In the "Choose an operation" search box, type "Power BI" and select it. From the list, choose Refresh a dataset.
You’ll be prompted to select the Workspace and Dataset you want to refresh. Pick them from the dropdowns. This step tells Power Automate which specific dataset in the Power BI Service to update.
3. Add a Delay (Optional but Recommended)
A Power BI refresh isn't instantaneous, it may take a few seconds or several minutes depending on the dataset size. If your next step is to send a notification, it's a good idea to add a small delay to give the refresh time to complete.
Click + New step, search for "Delay," and add the Delay action. Choose a delay of 5 or 10 minutes.
4. Add the Notification Action
Click + New step again. Search for "Microsoft Teams" and select it. Choose the action Post a message in a chat or channel.
Configure the Team and Channel where you want the message to appear. In the Message box, you can type your notification. You can even include a link back to the report.
Example message: "Good morning! ☀️ The Daily Sales Dashboard has been updated with the latest data. You can view the report here: [<your report link>]"
5. Save and Test Your Flow
Click Save. You can now use the Test button in the top-right to run the flow manually and verify everything works correctly. If successful, you'll see checkmarks on each step. This way, the automation will run on its own based on your schedule.
Method 3: Go Fully Custom with the Power BI REST API
For those with technical skills who need complete programmatic control, the Power BI REST API is the ultimate solution. An API (Application Programming Interface) allows different applications to talk to each other. The Power BI REST API lets you write scripts (in languages like Python or PowerShell) to manage your Power BI content, including triggering dataset refreshes.
When should you use the API?
- When you need to integrate Power BI refreshes into a larger data processing pipeline.
- When the limitations of Scheduled Refresh (8/day) or Power Automate are not sufficient.
- When you need to build custom applications that embed and interact with Power BI content.
How a REST API Call for Refresh Works (High Level)
Using the API is a developer-centric task, but here’s a simplified breakdown:
- Register an Application in Azure AD: First, you must register a new application in Azure Active Directory (AAD) and grant it the necessary permissions for Power BI.
- Authenticate and Get an Access Token: Your script will need to authenticate against Azure AD using the application's credentials to receive an authentication token. This token proves your script has permission to access Power BI.
- Make the API Call: With the token, your script sends a "POST" request to a specific Power BI API endpoint for refreshing datasets. It tells the API the ID of the workspace and the ID of the dataset to refresh.
For example, using PowerShell, a simplified version of the script might look like this:
# URL for the refresh API endpoint
$powerBiApiUrl = "https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes"
# Send the request with the auth token
Invoke-RestMethod -Uri $powerBiApiUrl -Method 'POST' -Headers $headersBodyThis method offers incredible power and flexibility, but it requires knowledge of scripting, authentication protocols (OAuth 2.0), and working with APIs. For everyday business users, sticking to Scheduled Refresh or Power Automate is far more practical.
Final Thoughts
Automating your Power BI reports is a game-changer for productivity. You can choose the simple, effective "Scheduled Refresh" feature for daily updates, leverage Power Automate for more complex notification workflows, or dive deep with the REST API for full programmatic control. By setting up these automations, you free yourself from repetitive tasks and ensure everyone is making decisions based on the freshest data available.
Handling all the steps involved in automating reports — from managing data gateways in Power BI to daisy-chaining apps in Power Automate — can still be complex and take time away from actual analysis. To help teams get straight to the insights, we built Graphed. We connect directly to your data sources like Google Analytics, Shopify, and Salesforce, and we handle all the pipeline management and automatic data refreshes in the background. Your dashboards are always live and up-to-date without you ever having to configure a scheduler or fix a broken gateway connection.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.