I once inherited a sales dashboard that pulled data from a colleague’s local Excel file — stored on her personal laptop. The day she went on leave, the report broke. I had to move that data source to a shared SharePoint folder, fast, without rebuilding the entire report from scratch. That’s when I learned every trick there is for changing a data source in Power BI.
This situation comes up more often than people expect. Maybe your company migrated from Excel to a SQL Server database. Maybe your file moved from a local folder to SharePoint. Maybe you’re just pointing a test report from a “Dev” database to “Production.” Whatever the reason, you don’t need to rebuild your report. You just need to know where Power BI stores that connection information and how to update it safely.
In this guide, I’ll walk you through every method to change a data source in Power BI Desktop and in the Power BI Service, plus how to handle the schema issues that often show up right after.
Why You’d Need to Change a Data Source in Power BI
A data source is simply the place your report pulls its raw data from — an Excel file, a SharePoint list, a SQL database, or a web API. Power BI stores a connection string to that source inside every query, so if the file moves or the server name changes, your report can’t find the data anymore.
The three most common reasons I see this happen on client projects:
- The file got moved to a new folder or migrated to SharePoint or OneDrive
- The company switched database servers (for example, moving from an on-premises SQL Server to Azure SQL)
- You’re switching between a testing environment and a live production environment
Whatever the case, Power BI Desktop gives you a few different ways to handle it, and the right one depends on how deep the change goes.
How to Change the Data Source in Power BI Desktop
Method 1: Using Data Source Settings
This is the quickest option, and it works well when the file path or server name changed, but the file or table structure stayed the same.
- Open your report in Power BI Desktop.
- Go to the Home tab and click Transform Data to open the Power Query Editor — this is the tool where all your data loading and cleanup steps live.
- In the Power Query Editor, click Data Source Settings (found under the Home tab).

- Select the data source you want to update from the list, then click Change Source.
- Enter the new file path, folder location, or server and database name.
- Click OK, then close and apply your changes.

This method updates the connection for every query using that same source, which saves you from editing each table one by one.
Pro Tip: I’ve found that Data Source Settings only updates the connection — it doesn’t touch your table or column names. If your new source has the exact same structure as the old one, your visuals and measures will keep working without a single change.
Method 2: Editing the Source Step in Power Query
Sometimes you need more control — like switching from an Excel file to a completely different source type, such as a SQL database. For that, go straight into the query steps.
- Open Transform Data to enter the Power Query Editor.
- In the Queries pane, select the table connected to the old source.
- In the Applied Steps pane on the right, click the gear icon next to the Source step.
- This opens a dialog specific to your connector (Excel, SQL, SharePoint, and so on). Update the path, server, or credentials here.
- Click OK and check that your columns still map correctly in the preview.
If your source happens to be a SharePoint list, it’s worth reviewing how to create a report from a SharePoint list in Power BI, since the connector setup differs slightly from a standard database or file connection. And if you’re unclear on the role Power Query plays versus the report canvas, this comparison of Power Query vs Power BI explains the distinction clearly.
Pro Tip: In my experience, editing the Source step directly is the safer option when you’re switching source types — like moving from an Excel workbook to a SharePoint list. Changing just the settings usually won’t work in that case, because the connector itself is different.
Method 3: Using Query Parameters (Best for Dev/Prod Switching)
If you regularly switch between a testing environment and a live one, hardcoding file paths gets tedious fast. Query parameters solve this by storing the source value in one central, editable spot.
- In the Power Query Editor, go to Manage Parameters and click New Parameter.
- Name it something clear, like
ServerName, and set a default value. - Edit your Source step to reference the parameter instead of a fixed value (for example, replacing the server name text with the parameter name).
- To switch environments later, just update the parameter value — every query using it updates automatically.
This is the method I set up for any client running reports across multiple environments. It turns a 20-minute manual update into a 10-second change.
How to Change Data Source in Power BI Service (Published Reports)
Once you’ve published your report to a workspace — a shared space in the Power BI Service where reports and dashboards live — changing the source works a bit differently, since you’re no longer working directly in Desktop.
- Sign in to the Power BI Service and open your workspace.
- Find your dataset, click the three dots next to it, and select Settings.
- Expand Data source credentials to update login details, or expand Gateway connection if your source sits behind an on-premises data gateway (a tool that lets cloud-based Power BI connect to data stored inside your company’s network).
- For a full path or server change, you’ll usually still need to update the source in Power BI Desktop first, then republish the report.
This is why I always recommend making structural source changes in Desktop before republishing, rather than trying to patch things live in the Service. It’s far less error-prone.
Once the new source is confirmed, don’t forget to check your scheduled refresh settings, since a refresh set up for the old data source can silently fail after the switch — this guide on setting up scheduled refresh in Power BI covers the setup in detail.
Handling Schema Changes After Switching Data Sources
The trickiest part of changing a data source isn’t the connection — it’s when the new source has different column names, extra fields, or a different date table structure. Here’s how I handle it:
- Open the Power Query Editor and check for red error icons on any step — these flag columns that no longer exist.
- Rename or remap columns in the Applied Steps to match what your visuals expect.
- If your relationships break because a key column renamed, go to the Model view and rebuild the relationship between tables.
- If the new source is missing a proper date table, you may need to build one from scratch — this guide on creating a date table in Power BI walks through it step by step.
The good news: your DAX measures (the formulas that calculate totals, averages, and other values in your report) usually keep working as long as the underlying column and table names stay the same. If you built a Total Sales measure referencing a Sales[Amount] column, and that column still exists with the same name in the new source, the measure doesn’t need any edits at all — you can review the basics in this guide to creating a measure in Power BI.
Pro Tip: I always test one visual first — usually a simple card visual or table — before assuming the whole report is fixed. It’s much faster to catch a broken column reference on one visual than after you’ve already reviewed all twelve pages of a dashboard.
Check out How to Filter Measure in Power BI?
Things to Keep in Mind
- Back up your original file before switching sources. If something breaks halfway through, you want the old version to fall back on.
- Match data types exactly. A date field stored as text in the new source instead of as a date will break your time-based measures and sorting.
- Refresh credentials separately from the source path. Even after updating the connection, Power BI may still prompt for new login credentials the first time it connects.
- Watch out for Row-Level Security. If your report uses Row-Level Security in Power BI to restrict what different users see, confirm the new source still has the same user or region mapping, or access rules can break silently.
- Test scheduled refresh after every source change. A refresh that worked yesterday can fail today if the gateway or credentials weren’t updated along with the source.
- Document the change. I keep a simple log of source changes for every client report — it saves hours when troubleshooting six months later.
Frequently Asked Questions
Why does my Power BI report show an error after changing the data source?
This usually means a column name, table name, or data type in the new source doesn’t match what your report expects. Open the Power Query Editor and check the Applied Steps for red error flags to find the exact step causing the problem.
Can I change a data source without losing my visuals and measures?
Yes, as long as the new source has the same table and column names as the old one. Your visuals and measures reference those names directly, so matching structure means little to no rework.
How do I change the data source for a report that’s already published?
You typically need to update the source in Power BI Desktop first, then republish the file to overwrite the version in your workspace. For credential-only changes, you can update them directly in the Service under dataset settings.
What’s the difference between changing Data Source Settings and editing the Source step?
Data Source Settings updates the path or server for an existing connector type, like moving one Excel file to another folder. Editing the Source step directly lets you change the connector itself, such as switching from Excel to a SQL database.
Does changing the data source affect scheduled refresh?
It can. If the new source needs different credentials or sits behind a different gateway, your existing refresh schedule can fail until you update those settings in the Power BI Service.
Should I use query parameters if I only change sources once?
Not necessarily. Query parameters are most useful when you switch sources regularly, like moving between test and live environments. For a one-time permanent move, updating Data Source Settings is simpler.
Changing a data source in Power BI doesn’t have to mean rebuilding your report — with the right method, it’s usually a five-minute fix. Start with Data Source Settings for simple path changes, and only dig into the Source step or parameters when you need more control. I hope you found this article helpful.
You may also like
- Explore real Power BI dashboard examples for layout and design inspiration
- Learn how to build KPI visuals to track performance metrics at a glance
- See how to add slicers so users can filter reports interactively
- Get tips on using the card visual to highlight key numbers
- Learn how to add filters in Power BI to control what data each visual shows

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.