Fix Power BI Dynamic Data Source Error in SharePoint Folders
Question details
The user needs to refresh a Power BI dataset combining Excel files from multiple SharePoint folders, but encounters a dynamic data source error in Power BI Service.

- Product
- Microsoft Power BI
- Device & OS
- not provided
- Scenario
- Combining similarly structured Excel files from multiple SharePoint folders using Power Query.
- Observed behavior
- Power BI Service reports a dynamic data source error and fails to refresh the dataset. Scripts, macros, and some Power Automate connectors are restricted or unavailable.
Verify your Power BI Service licensing capabilities and ensure you have continuous read access permissions to all targeted SharePoint folders.
Consult the Microsoft Power BI Community for Supported Workarounds
Because this involves specific Power BI Service refresh behaviors and dynamic Power Query logic, consulting the official community is the best way to find a supported structural workaround.
Power BI Service strictly requires data sources to be statically discoverable before query execution. When URLs or folder paths are generated dynamically, the cloud service blocks the refresh for security and architectural reasons.
Document your current Power Query M code structure, parameter configurations, function designs, and how you connect to SharePoint.
Clearly state the exact refresh error message you are receiving and mention your environmental restrictions (e.g., scripts, macros, and specific Power Automate connectors being unavailable).
Visit the official Microsoft Power BI Community forums, create a new thread with your detailed findings, and ask for alternative structural designs to handle multiple SharePoint paths statically.

Restructure Query Using Web.Contents and RelativePath
Use the RelativePath option inside Web.Contents to separate the static base URL from the dynamic folder path, allowing Power BI Service to recognize the data source.
Manage Your Excel Data Source Files Easily with WPS Office
While you use Power BI for complex dashboard reporting and data modeling, you can seamlessly prepare, clean, and manage your underlying Excel source files using WPS Office. It is a highly compatible, free, and lightweight alternative to Microsoft Office.

Frequently Asked Questions
Why does Power BI Service give a dynamic data source error?
This error occurs because Power BI Service performs static code analysis on your queries to determine data sources before execution. If a URL or file path is generated dynamically (e.g., through variables or row-by-row string concatenation), the service cannot verify the data source credentials, thereby blocking scheduled refreshes.
Can I consolidate multiple SharePoint folders without Power Query?
Yes, if your environment permits, you can use available Power Automate flows or standard SharePoint move/copy functions to consolidate the necessary Excel files into a single designated SharePoint folder. Power BI can then safely point to that single folder using a standard, static query.
Are macros required to fix dynamic data source errors?
No, macros are not required. The most reliable fix is restructuring your M code directly in the Power Query Editor using functions like Web.Contents with the RelativePath option, ensuring the base URL remains static while navigating sub-directories.




