How to Change Dataflow Source in Power BI
Sooner or later, every Power BI user hits a point where they need to change the data source for a dataflow. Maybe you're finally promoting your report from a test database to the live production server, or perhaps your team has migrated a folder of Excel files from a local drive to a central SharePoint site. Whatever the reason, you need to update your query's connection without breaking everything. This guide will walk you through exactly how to do it, from a simple source swap to using parameters - a best practice that will save you big headaches down the road. We'll also cover the common errors you might encounter and how to fix them.
What Exactly Is a Power BI Dataflow?
Before we jump into the "how," let's quickly clarify what we're working with. A Power BI dataflow is a self-service data preparation process that lives in the cloud (Power BI Service). Think of it as a reusable recipe for cleaning and transforming your data. You define the steps in Power Query Online once - connecting to sources, filtering rows, merging tables, adding columns - and that dataflow can then be used as a clean, ready-to-go data source for multiple Power BI reports.
This is extremely powerful because it separates data prep from your reporting. Instead of ten different reports, each with its own complicated data cleaning steps, you can have one dataflow that feeds clean data to all of them. But this centralization also means that when a source changes, you need to know how to update it at the dataflow level.
Common Reasons to Change a Dataflow Source
You'll typically find yourself needing to change a dataflow's source for a few common reasons:
- Environment Promotion: Moving from a development or staging environment (like a test SQL database) to a live production environment.
- Data Migration: Your company might move its data from an on-premise server to a cloud-based one (e.g., SQL Server to an Azure SQL Database), or from one file storage system to another (e.g., a local server drive to SharePoint Online).
- Credential or API Updates: The login details for a database may have changed, or an online service you connect to has updated its API endpoint URI.
- Consolidating Files: You might be switching from a single CSV or Excel file to a folder containing multiple, similarly formatted files that need to be combined.
Method 1: Change The Source Directly in Power Query Online
The most straightforward way to change your data source is directly within the Power Query Online editor in the Power BI Service. This method is great for a one-time change.
Follow these steps to update your connection:
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
1. Navigate to Your Dataflow
Start by logging into your Power BI Service account at app.powerbi.com. In the left-hand navigation pane, find and open the workspace that contains your dataflow.
2. Open the Dataflow in Edit Mode
Once in your workspace, find your dataflow in the list of assets. Click the three dots (More options) next to its name and select Edit. This will launch the Power Query Online editor, which should look very familiar if you've ever used Power Query in Power BI Desktop.
3. Locate Your Data Source Settings
Inside the editor, you'll see your queries listed on the left. The approach here can vary slightly depending on your source. For many database or web sources, you might see a gear icon next to your Source step in the "Applied Steps" pane on the right. Clicking this icon is the most direct way to open the configuration window.
If you don't see a gear icon or you're using a file-based source, you can use the ribbon. Go to the Home tab, click the drop-down for Options, and select Project options. Here you can manage your Data Sources used in this dataflow, although it is often easier to find the query first.
4. Update the Connection Details
After clicking Configure connection, a pop-up window will appear where you can directly edit the connection details. For example:
- For a SQL Server database: You would change the Server and Database names from your test values (e.g.,
test-sql-server-01) to your production values (e.g.,prod-sql-db-01). Then select Sign-In and you will likely see fields to update the credentials for this data source - be sure to provide 'edit' access when providing credentials. Choose an authentication method if required and enter your new username and password. - For an Excel file on SharePoint: You would update the SharePoint site URL or folder path. You should use the 'SharePoint File Picker', not the URL by pasting its URL directly for proper authentication if at all possible. This process is documented extensively in several BI blogs on best practice here where you could use
Team Sharesor by finding the Group Folder via GUI.
5. Apply Changes and Save
After entering the new details and authenticating successfully, click Connect to confirm the changes. Power Query will try to refresh the data preview using the new source. If it succeeds, you're good to go! Click the Save & close button in the bottom right corner of the editor. Remember to manually trigger a refresh of your dataflow after saving to pull in the fresh data from the new source.
Method 2: Using Parameters for an Easier, Adaptable Setup
Manually editing connections works, but it can be tedious if you need to do it often (for example, managing development, staging, and production versions). A far better and more scalable approach is to use parameters. Parameters act like variables in your queries, allowing you to change key values like server names or file paths without digging into the queries themselves.
1. Create Your Parameters
While editing your dataflow in Power Query Online, go to the Home tab and click Manage Parameters. A new window will pop up.
Here, you'll create parameters for the dynamic parts of your connection. For a SQL database, you might create:
- Name:
pServerName, Type:Text, Current Value:test-sql-server-01 - Name:
pDatabaseName, Type:Text, Current Value:TestSalesDB
Click OK to save your new parameters.
2. Use Parameters in Your Query Source
Now, we need to tell our query to use these parameters instead of the "hard-coded" values. Select the query you want to update.
- With that query selected, go to the Home tab and click Advanced Editor to view the M code.
- Find the Source step. It will probably look something like this:
let
Source = Sql.Database("test-sql-server-01", "TestSalesDB")
in
Source- Modify that line to use the parameters you created. Note that the quote marks are removed because you're now referencing the parameters, not static text values:
let
Source = Sql.Database(pServerName, pDatabaseName)
in
SourceClick Done to close the Advanced Editor. Power Query will now use the "Current Value" from your parameters to connect to the data.
3. Changing the Source Moving Forward
The beauty of this setup is that from now on, you don't need to open the query editor to change the source. Go back to your workspace's settings. Find your dataflow, but this time just view the details—do not select Edit. In the Settings for the given item(s), e.g., a specific DataFlow, you'll see a section for available defined and used parameters. You can update the source system by simply changing the 'value' for pServerName to reflect the path of your new server, for example, pServer to serverPRODxyz in that parameter screen. Saving from here immediately applies changes to everything automatically because all steps already use referential naming constructs.
Troubleshooting Common Problems
Changing data sources doesn't always go smoothly. Here are a few common issues and tips on how to resolve them.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Credential or Authentication Errors
This is the most common hurdle. If you get a failure notice, double-check your credentials. Also, Power BI caches credentials. Go to Settings > Data source credentials in the Power BI Service and clear out any old, stored credentials for that data source. This forces Power BI to prompt you for new credentials for the changed dataflow's connection string at the next refresh.
Schema Errors: "The column 'ColumnName' of the table wasn't found."
This error means your new data source has a different structure than the old one - a column was renamed, removed, or has a different data type. When this happens, a later step in your Power Query transformation (like "Changed Type" or "Renamed Columns") fails because it can't find the column it's looking for.
Solution: Open the Power Query editor and look for the step with the error (it will be marked in red or yellow). Review that step and adjust it to match the schema of your new data source. You might need to change a column's name, remove a step that references a non-existent column, or adjust a data type.
Final Thoughts
Changing a dataflow source in Power BI is a fundamental skill, and mastering both the direct edit and the parameter-based methods gives you the flexibility to handle any scenario. While direct edits are quick for one-off changes, taking the time to set up parameters is an investment that makes your dataflows more robust and far easier to manage in the long run.
We know that managing connections, credentials, and settings across dozens of different platforms is exactly the kind of manual drag that keeps teams from focusing on actual analysis. That's why we built Graphed. Our platform simplifies the entire process by letting you connect your marketing and sales data sources in just a few clicks. Then, you can build real-time dashboards just by asking questions in plain English. We handle the data connections, the refreshes, and all the plumbing in the background so you can get insights in 30 seconds instead of spending 30 minutes wrangling connections.
Related Articles
Facebook Ads for Assisted Living: The Complete 2026 Strategy Guide
Learn proven Facebook ad strategies for assisted living facilities in 2026. Discover how to target adult children and seniors, create compelling ads, and maximize your ROI with retargeting and video content.
Facebook Ads for Optometrists: The Complete 2026 Strategy Guide
Learn how to run effective Facebook ads for optometrists in 2026. Discover campaign strategies, targeting tips, creative best practices, and budget guidelines for eye care practices.
Facebook Ads for Veterinarians: The Complete 2026 Strategy Guide
Learn how to use Facebook ads to attract more pet owners to your veterinary practice. Complete strategy guide for 2026 with targeting tips, ad formats, and best practices.