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

Dynamic Source path

Hi All,

 

Can someone help me in setting up dynamic source path in power query?. My data will be placed with different folder name.

 

Appreciate your support!!

1 ACCEPTED SOLUTION
jennratten
Super User
Super User

This is how you can use parameters to make a source file name and path dynamic:

 

Create 2 parameters - one for the file name and one for the file path.

 

jennratten_0-1658414590492.png

 

Replace the hard-coded file name and path with the parameters.  In this example I am connecting to an Excel file.  

jennratten_1-1658414682839.png

 

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

View solution in original post

3 REPLIES 3
admdc01
Frequent Visitor

hello, with all due respect this is not dynamic as you are stating "hard-coded" filename. As far as i know there is no direct way to implement dynamic links in power bi. 
On the contrary.. in excel power query there is a solution which might be applied in Power BI.

Create an excel file named parameters and save it at the same place as the pbix file;

Name  cell A1 : folderPath

type the following formula in that cell
 =LEFT(CELL("filename";A1);FIND("[";CELL("filename";A1))-1)

That formula gets the excel file path 🙂 which is dynamic as it updates whenever you move the excel file from one folder to another.

In Power BI, connect the excel file and read the content of the cell named folderPath --> your dynamic path is now active

 

 

 

Anonymous
Not applicable

Hi @Sudharsanan ,

 

Here's a way to set up dynamic file path by creating parameters, please kindly refer to

Create Dynamic File Path in Power Query - Goodly

Changing File Location Using A SQL Query Parameter In Power BI | Enterprise DNA

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jennratten
Super User
Super User

This is how you can use parameters to make a source file name and path dynamic:

 

Create 2 parameters - one for the file name and one for the file path.

 

jennratten_0-1658414590492.png

 

Replace the hard-coded file name and path with the parameters.  In this example I am connecting to an Excel file.  

jennratten_1-1658414682839.png

 

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors