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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Nietzsche
Helper III
Helper III

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

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors