Parameterizing your data sources
Parameters can be to store data source information, such as server and database names, file paths, filenames, and even input parameters to SQL stored procedures. With multiple queries leveraging the same M query parameter values, implementing changes, such as migrations from development or QA environments to production environments, becomes very straightforward.
Two examples of parameterized data sources are described in this recipe, including the server and database of an SQL Server database and the directory path and file name for an Excel workbook. Additionally, M query parameters are assigned to the input parameters of a SQL stored procedure.
Getting ready
- Identify the components of data sources that are subject to change and, if available, the list of possible values for these parameters, such as servers, databases, Windows directories, and filenames.
- Create a group folder in Power BI Desktop to store parameter values and related queries:

Query Group of...