Forum Discussion

Keny's avatar
Keny
Frequent Visitor
2 years ago
Solved

Automatically change data sources

I have several reports connected to the development databases, each with multiple data sources. Currently, teams waste a lot of time redirecting connections to the production environment. I'd like ...
  • manvishah17's avatar
    2 years ago

    Hi Keny ,

    In Power BI, you can streamline switching data sources between development and production environments by using parameters and configuration files. Here’s a summary of the steps:

    1. Create Parameters: Define parameters for parts of your data source connection that change (e.g., server name, database name).

    2. Use Parameters in Queries: Modify your data source connections to use these parameters in Power Query Editor.

    3. Create a Configuration File: Make a file (e.g., Excel or JSON) that contains different environment configurations.

    4. Switch Environments Using Parameters: Load the appropriate environment settings from the configuration file into the parameters.

    5. Automate Parameter Updates: Use Power Query M code to dynamically update parameters based on the selected environment.
      https://learn.microsoft.com/en-us/power-query/power-query-query-parameters