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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
FreemanZ
Super User
Super User

How to bulk change the source location for queries from different files in the same folder?

How to change the source location for queries from different files in the same folder?
 
Supposing I have 10 Excel files of different dimentions in one folder. Someday, I rename the folder or I move the whole foler elsewhere. I can update the folder in the first Source step, for one query after another. Is there a good way to change the source easily? 
 
If all queries are from one excel file, it could be done with parameters. 
If all queries are from different excel files but with similar type and to be appended, it is also easy. 
 
Is there similar convinent way for queries from different files of different type/dimention in the same folder?
1 ACCEPTED SOLUTION

Thank you Jorge. I found this article works and solves the problem.

https://powerbi.tips/2016/08/using-variables-for-file-locations/

 

Adding the back slash at the end of the copied file path saves my day. Preciely the line below:

= Excel.Workbook(  File.Contents(   Folder  &   "2000 Medals.xlsx") ,   null , true )

Thank you Jorge to give me the hint and confidence working in this direction. 

View solution in original post

5 REPLIES 5
FreemanZ
Super User
Super User

hi Jorge, 

Many thanks for the quick reply.

Could you stipulate how it works? Or help google an relevant article or video?

 

i tried and failed. 

I get below:

FreemanZ_0-1666704120338.png

at point 1, the parameter is used. at point 2, it is still with the raw folder path. 

If i replace the folder path with Source, I get an error. 

Thank you Jorge. I found this article works and solves the problem.

https://powerbi.tips/2016/08/using-variables-for-file-locations/

 

Adding the back slash at the end of the copied file path saves my day. Preciely the line below:

= Excel.Workbook(  File.Contents(   Folder  &   "2000 Medals.xlsx") ,   null , true )

Thank you Jorge to give me the hint and confidence working in this direction. 

You're welcome 🙂 Well done!

I reccomend you the following:

 

1. Create a parameter with the folder path

2. Go to New Source choose Folder

3. When it asks for the path change to parameter 

JorgePinho_0-1666705030975.png

 

JorgePinho
Solution Sage
Solution Sage

The same way you can use parameters for one excel file you can also make for the folder path.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors