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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
scott_Abaana
Helper I
Helper I

Location of Power Query Files

I have a power Query with 7 different files sources feeding into it. 

 

I have organised these into 3 Folders in the same location on my hard Drive saved on One Drive. Recently my one drive stopped syncing and so have to reconnect and now I have to move my folder to the new one drive to ensure it is synced online.

 

I am very aware that Power Query remembers the exact location of the source files, so moving them will be an issue.

 

Other than working through each query when it is loaded and changing the file paths individually is there any way to do this quicker. I have one drive on my Laptop and my offfice machine and it would be nice for the query to work in more than one location. Is there any way to set the source lcoation to be releative to the Query file? Otherwise the query files really can't be easily shared.

 

Thanks

1 ACCEPTED SOLUTION

Well, there's allways more than one way to skin a cat:

A very dirty method might be to re-name the parent folder, then go into Power Query and do a Refresh All and see what fails. 🙂

 

Maybe try some 3rd party tools like DAX Studio or Tabular Editor. This article introduces adding them directly into Power BI Menu and offers some links: https://powerbi.microsoft.com/en-us/blog/announcing-public-preview-of-external-tools-in-power-bi-des...

 

Best of luck.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
ToddChitt
Super User
Super User

I don't think you can specify a relative path in the File source query. But you can use a Power Query Parameter for the Folder portion. 

 

Suppose all your files are under sub folders under C:\My One Drive with a really long path name that I don't want to keep re-typing\

Create a Parameter of type Text, with that value. 

Then in each of the File Sources, substitute the literal path string with the Parameter name and concatenate the file name.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





@ToddChitt 

 

Thats sound like a good work around because if you change the parameter I assume that would change all the locations it points to.

 

I found a video for using this and I think I have it working for one table.

 

Question: if you have say seven files with  "C:\My One Drive with a really long path"

 

Is there a way you can find all these in power query (Like a searching a text string through all the code)

Well, there's allways more than one way to skin a cat:

A very dirty method might be to re-name the parent folder, then go into Power Query and do a Refresh All and see what fails. 🙂

 

Maybe try some 3rd party tools like DAX Studio or Tabular Editor. This article introduces adding them directly into Power BI Menu and offers some links: https://powerbi.microsoft.com/en-us/blog/announcing-public-preview-of-external-tools-in-power-bi-des...

 

Best of luck.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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