How to Change the Dataset of a Report in Power BI

Cody Schneider••8 min read

Switching the data source for a Power BI report you’ve already spent hours building can feel like a daunting task. The good news is you don’t have to rebuild everything from scratch. This article will show you exactly how to change the underlying dataset of your report in Power BI Desktop and introduce a more advanced method using parameters to make this process even smoother in the future.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why Would You Need to Change a Dataset?

While you might not do it every day, swapping out the data source for a Power BI report is a common task. There are several practical scenarios where this functionality becomes a lifesaver:

  • Migrating from Development to Production: This is the most frequent use case. You build and test a report against a small, sample, or development database. Once it's approved, you need to point it to the live, production database for real-world use.
  • Upgrading Your Data Source: Your company might decide to move from storing sales data in an Excel or Google Sheets file to a more robust SQL database. Instead of rebuilding the report, you can simply reroute the connection.
  • Data Source Location Changes: The server name changes, a database is migrated to a new host, or a shared file is moved to a different SharePoint site. Changing the dataset is much faster than recreating every single visual.
  • Creating Report Templates: You might create a standardized marketing performance report. You could then save copies of this .pbix file and point each copy to the dataset of a different client, saving massive amounts of time.

Before You Begin: Important Considerations

Before you jump in, a little preparation can save you from a major headache. The success of a dataset swap depends almost entirely on one thing: consistency. If the new dataset's structure doesn't closely match the old one, Power BI won't know how to render your visuals.

Step 0: Back Up Your Report!

This is non-negotiable. Before you change anything, save a copy of your .pbix file. Go to File > Save As and give it a name like MyReport_V1_BeforeDatasetChange.pbix. If anything goes wrong, you’ll have a clean version to fall back on. Do not skip this step!

Check for Data Structure Consistency

For a seamless transition, your new data source must have the exact same schema as the old one. This means:

  • Table Names: If your original report pulled data from a table named Sales_Data, the new source must also contain a table with the exact name Sales_Data.
  • Column Names: Similarly, if your visuals use columns like Product_Name, Sale_Amount, and Order_Date, these columns must exist with identical names in the new source.
  • Data Types: Mismatched data types can cause unexpected behavior. A column that was a number in the old source should be a number in the new one. A date should be a date, and text should be text. Mismatches can break measures, relationships, and even visuals.

If these schemas don't match, you're not out of luck, but you will have to manually fix any broken visuals and DAX measures after the swap.

Step-by-Step Guide: Changing the Dataset in Power BI Desktop

With a backup saved and your new data source ready, it’s time to make the switch. Follow these steps carefully.

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.

Step 1: Open Your Report in Power BI Desktop

First things first, open the .pbix file for the report you want to update.

Step 2: Access Data Source Settings

With an active report, navigate to the File menu ribbon at the top left. Click on File > Options and settings > Data source settings.

This opens a new window listing every data source currently connected to your report. For a simple report, you might only see one. For a complex one that pulls from multiple places, you’ll see each source listed here.

Step 3: Choose and Change the Source

In the "Data source settings" window, select the source you want to replace. The Change Source... button at the bottom will become active. Click on it.

Example: Let’s say your report is connected to an Excel file on your C: drive, and you want to point it to a new version on SharePoint. You’d select the Excel data source and click "Change Source..."

Step 4: Connect to the New Data Source

A dialog box specific to that data source type will appear, prompting you for new connection details. You’ll need to provide the necessary information to connect to your new source.

  • For an Excel file: You'll be asked to browse for the new file path.
  • For a SQL Server database: You'll be prompted to enter the new Server name and, optionally, a new Database name.
  • For a SharePoint folder: You'll be prompted to enter the new SharePoint Site URL.

Fill in the new details and click OK.

Step 5: Apply Changes and Refresh

Once you’ve provided the new source details, you will be brought back to the "Data source settings" window. Click Close.

A yellow banner will appear at the top of your report canvas that says, "There are pending changes in your queries that haven't been applied."

Click the Apply changes button. Power BI will now attempt to connect to the new data source and refresh all your data. If the connection is successful and the schema is a match, all of your existing visuals will populate with data from the new source. Congratulations, you're done!

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Troubleshooting Broken Visuals

What if it doesn't work perfectly? If there's a difference between the old and new dataset schemas, you'll see errors on your report canvas.

  • Look for any visuals that show an error message like "Can't display the visual".
  • Go to the Fields pane on the right side of the screen. Power BI is usually good about highlighting missing fields with a small warning icon.
  • If a field named Sale_Amt was changed to Sale_Amount in the new source, you'll need to update each visual that used it. To do this, simply drag the new Sale_Amount field from the Fields pane and drop it onto the broken field well in the Visualizations pane.
  • Rinse and repeat for any DAX measures or calculated columns that are broken. You may need to edit them to reference the new column names.

Best Practice: Using Parameters for Smoother Transitions

Manually changing the source works, but for situations where you might switch data sources frequently (like managing development, staging, and production environments), there’s a much more efficient way: using parameters.

Parameters allow you to store connection details like a server name or file path in a separate variable. Then, instead of just updating the connection, you only have to update the variable's value.

Step 1: Open the Power Query Editor

From the Home ribbon, click on the Transform data button. This opens the Power Query Editor, which is where all data transformation magic happens.

Step 2: Create New Parameters

In the Power Query Editor’s Home ribbon, click Manage Parameters > New Parameter. Let’s create one for a database connection.

Set it up like this:

  • Name: DataSource_Server
  • Description: The server name for the database connection.
  • Type: Text
  • Current Value: DEV_SQL_SERVER_01 (your development server name)

You can create another parameter for the database name, which we could call DataSource_Database.

Step 3: Update Your Query to Use the Parameters

In the list of Queries on the left, select the query connecting to your database. In the Applied Steps pane on the right, click the gear icon next to the very first step, which is usually named Source.

This will open the connection settings window. Instead of hardcoding the server name, click on the small dropdown menu and change it from "Text" to "Parameter". Now, you can select the DataSource_Server parameter you just created. Do the same for the database field using your DataSource_Database parameter.

Click OK. You won't see any immediate change, but behind the scenes, Power BI is now using those parameters to connect. If you look at the M code in the formula bar, you'll see the change:

Before:

= Sql.Database("DEV_SQL_SERVER_01", "Sales_Dev_DB", [Query="..."])

After:

= Sql.Database(DataSource_Server, DataSource_Database, [Query="..."])

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.

Step 4: Change Datasets in Seconds

Close and apply your changes in the Power Query editor. Now, whenever you need to switch your report from the development database to the production one, you just have to go to Transform data > Edit parameters right from the main Power BI window. Change the value of DataSource_Server to PROD_SQL_SERVER (or whatever your production server is called) and click OK. Refresh the report, and you're done!

This method is safer, faster, and far less prone to error than changing the data source settings manually every single time.

Final Thoughts

Changing the dataset of a Power BI report is a core skill that moves you from being a beginner to an intermediate user. While the process of using "Data source settings" is straightforward, consistency between your old and new data structures is what guarantees a smooth swap. For even greater efficiency and control, learning to implement parameters will save you countless clicks in the long run.

Of course, while managing datasets and parameters in Power BI is a valuable skill, it still involves several steps and the potential for manual errors, especially when you have data scattered across a dozen different platforms. This is where we designed Graphed to simplify your reporting life entirely. You can connect all your data sources just once - from Google Analytics and Facebook Ads to Salesforce and Shopify - and then use plain English to build real-time, interactive dashboards. Graphed automates the connections, refreshes your data automatically, and lets you ask questions instead of hunting through menus, so you can focus on insights, not setup.

Related Articles