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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LadyLily
Regular Visitor

Power Query - How to Change Data Source and Use Same Queries

Hello, 

 

I am using Power Query in Excel and I'm new to the function so apologies if this is very straightforward. I have multiple budget workbooks that have different names but the sheets are all named the same - Task 1, Task 2, Task 3 etc to Task 20.

 

I opened a new workbook, chose one of the budget workbooks as my data source, created a query named for each tab to clean the data in order to export it to a flat .csv file for upload into another program. 

 

This worked perfectly until I went to swap out the data source with a workbook with a different name. Instead of my queries for each task sheet running against the new data source, the Power Query Editor Added Task 1 (2), Task 2 (2), Task 3 (2) to my already existing list of queries. 

 

How do I change the data source for each of the existing queries without them duplicating? I tried to select all of my queries and change the source in the first applied step which actually worked but it only made the change on the last query in my selection. 

 

Is there an easier way to do this then manually going into the Source applied step for each of my 20 queries?

 

Thank you. 

1 ACCEPTED SOLUTION
BKirsch12
Resolver II
Resolver II

Are all your spreadsheets in the same exact format?

 

If so, you can use the from folder, and combine all the files.

 

Good link on this approach:  https://www.youtube.com/watch?v=4fFL7Ok7Ovg

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

I agree with @BKirsch12 that you probably want a Folder query here. But, if that is not what you are looking for, then you could create a query that just pulls in the data and does no other steps. Then, you would create your queries and reference that query. That way, you could just change the one query and all of your other queries would be pointing to the correct data source.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
BKirsch12
Resolver II
Resolver II

Are all your spreadsheets in the same exact format?

 

If so, you can use the from folder, and combine all the files.

 

Good link on this approach:  https://www.youtube.com/watch?v=4fFL7Ok7Ovg

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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