pbi_parameterize_data_source
Replace hardcoded file paths in Power BI data sources with a parameter, enabling collaborators to change the file location from Manage parameters dialog without editing queries.
Instructions
Make data sources portable via a Power Query parameter.
Creates (or updates) an M parameter named parameter_name whose default
value is file_path. Then rewrites every M partition that string-matches
file_path so it calls File.Contents(<parameter_name>) instead of the
hardcoded path. After the parameter is wired in, a collaborator can change
the file location once via Power BI Desktop's Transform data → Manage
parameters dialog without editing each query.
partitions: optional explicit list of "Table[/Partition]" to rewrite. By
default every M-source partition that references file_path is rewritten.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| file_path | Yes | ||
| partitions | No | ||
| refresh_after | No | ||
| parameter_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |