Showing results for 
Search instead for 
Did you mean: 
Resolver II
Resolver II

Using the current folder as a variable as the Import Folder for other files?

I would like to give a powerBI to someone else to use that does not have access to my folder.

I maintain a couple excel files that create input parameters for the subsequent table imports.

I would like to modify the import code of this excell file to be relative to the current folder the pbix file is in.


How do I do that?



    Source = Excel.Workbook(File.Contents("C:\Subfolder\Example\SitURLs.xlsx"), null, true),




    Source = Excel.Workbook(File.Contents(""& PV_Folder &"\SitURLs.xlsx"), null, true),


[edited for clarity?]

Super User IV
Super User IV

To my knowledge, there is no automagical way to get the current folder as a parameter to a query. That being said, you can use the "Manage Parameters" in the Power Query editor to create a parameter for folder that the end user can edit to be the correct path. In the Power Query Editor on the Home tab, use the "Manage Parameters" dialog to create a new parameter.


@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Thanks smoupre,

I am going to keep hunting, but for now will hardcode a folder as a parameter that can be updated

Hi @I_Like_Pi,


Currently, the available values for a parameter can only from a hardcode list. For the feature to get parameter available values from a query, I would recommend you submit a feature request in the idea forum:





Charlie Liao

Helpful resources

PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors