Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Nietzsche
Helper V
Helper V

How to change Power Query source and keep all steps and queries etc

Hello, I am currently reading a book called Mastering Microsoft Power BI by Deckler and Powell.

 

The book comes with PBIX files hosted on github that's connected to AdventureWorks files that's located on the author's SQL Server database. 

So if you download any of the PBIX files that the author has provided you will see the data source settings like this

Nietzsche_0-1714706915388.png

 

Since obviously I do not have access to the author's database, I downloaded the bak file provided by the author and restore it on my own SQL Server database. 

Nietzsche_1-1714707041706.png

 

I want to change the data source for all the queries in the pbix and point them to my own SQL Server database, there are many queries as shown

Nietzsche_2-1714707158583.png

 

Whenever I tried to change edit source, it just ask me for creditial to the author's database which I obviously do not have. 

Nietzsche_3-1714707302263.png

 

So is there a way to change data source for any of the queries? If so, can do I once for all of them?

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Nietzsche ,I am glad to help you.
Unfortunately, if you have more than one data source, you will need to modify each one of them.
If what I provided above about modifying data sources in power query works, for your second question: if your report relies on several different data sources, you could modify them one by one in the query editor of power query. You could also create parameters and use them instead of complex data sources.

Here are my test results.

vjtianmsft_0-1714722113794.png

vjtianmsft_1-1714722124820.png

The advantage of creating parameters is that you can centralise the management of parameters, and in the future if your own data source changes, you only need to change the value of the centrally managed parameter, which saves management time. However, a parameter generally represents a path to a data source, so you will need to create multiple parameters to manage.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Nietzsche
Helper V
Helper V

awesome, thank you for your fast and detailed replies. You're an asset to the community.

Anonymous
Not applicable

@Nietzsche ,Glad to help!

You can try to see if opening the editor in power query to see if the current data source is the original data source

Here are the results of my test:

The demo here is 2017,I'm going to change it to 2019, both databases have this table.

vjtianmsft_0-1714711281754.png

vjtianmsft_1-1714711298514.png

Then modify it to your own data source
like this:

AdventureWorks2017 = Source{[Name="AdventureWorks2019"]}[Data],

vjtianmsft_2-1714711413339.png

There is no error even after modifying the data.

vjtianmsft_3-1714711432807.pngvjtianmsft_4-1714711441654.png

 

So you can modify the data into your own data source, please ensure the consistency of the data, and can correctly provide the access credentials of your own database.

I hope my suggestions  give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

I think I figured it out how to replace the data source.

 

Does that mean I have to change the data source one by one in Advanced Editor for all queries involved? 

Anonymous
Not applicable

Hi @Nietzsche ,I am glad to help you.
Unfortunately, if you have more than one data source, you will need to modify each one of them.
If what I provided above about modifying data sources in power query works, for your second question: if your report relies on several different data sources, you could modify them one by one in the query editor of power query. You could also create parameters and use them instead of complex data sources.

Here are my test results.

vjtianmsft_0-1714722113794.png

vjtianmsft_1-1714722124820.png

The advantage of creating parameters is that you can centralise the management of parameters, and in the future if your own data source changes, you only need to change the value of the centrally managed parameter, which saves management time. However, a parameter generally represents a path to a data source, so you will need to create multiple parameters to manage.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.