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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Nietzsche
Helper IV
Helper IV

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

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 IV
Helper IV

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

v-jtian-msft
Community Support
Community Support

@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? 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.