Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi,
I'd like to know if there is a way to dynamically set a folder path if I have to update all the Excel files in the folders every week?
IE:
On my desktop, I have a folder named: KPI.
KPI has 5 sub-folders:
1. Time
2. Work
3. Employee
4. Sales
5. Status
All 5 of them have Excel files.
The problem I'm having is if I move the KPI folder from the desktop, I'll have a problem with the queries.
Is there a solution to this?
Solved! Go to Solution.
I think this there is another way to make folder dynamic
This is via an Excel Table or Named Range
Now in your query you can define the folderpath which is linked to a Cell in ExcelTable
let
FolderPath= Excel.CurrentWorkbook(){[Name="FolderDefinition"]}[Content]{0}[Column1],
Source = Excel.Workbook(File.Contents(FolderPath & "FileName.xlsx"), null, true),
MyTable = Source{[Item="Table1",Kind="Table"]}[Data]
in
MyTable
Hi @misen13
Here is the document for your reference.
https://biinsight.com/power-bi-desktop-query-parameters-part-1/
Regards,
Cherie
I think this there is another way to make folder dynamic
This is via an Excel Table or Named Range
Now in your query you can define the folderpath which is linked to a Cell in ExcelTable
let
FolderPath= Excel.CurrentWorkbook(){[Name="FolderDefinition"]}[Content]{0}[Column1],
Source = Excel.Workbook(File.Contents(FolderPath & "FileName.xlsx"), null, true),
MyTable = Source{[Item="Table1",Kind="Table"]}[Data]
in
MyTable
Hi @misen13
You can use Parameters
Define your folder address in a parameter and use it as a reference in your Queries.
So when you change the folder.. you just have to change address once in the Parameter
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 136 | |
| 110 | |
| 50 | |
| 32 | |
| 29 |