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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I am using an Excel file stored on Sharepoint site and I would like to keep the folder dynamic.
It currently hits an error during data refresh on Power BI Service.
Here is my code:
strFolder = TblFolder{0}[Data Folder],
Source = Excel.Workbook(Web.Contents(strFolder & "Alibaba.xlsm"), null, true),
Appreciate your help.
hcze
Solved! Go to Solution.
@hcze
You can create a query parameter with foldernames. Then apply the parameter to code, make the str folder = the parameter name (Folder Name in the example). Something like:
strFolder = TblFolder{0}[Folder Name]
Source = Excel.Workbook(Web.Contents(strFolder & "Alibaba.xlsm"), null, true),
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
@hcze
You can create a query parameter with foldernames. Then apply the parameter to code, make the str folder = the parameter name (Folder Name in the example). Something like:
strFolder = TblFolder{0}[Folder Name]
Source = Excel.Workbook(Web.Contents(strFolder & "Alibaba.xlsm"), null, true),
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.