Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Keny
Frequent Visitor

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 to know if there is any way to create a configuration file (or something similar) with production connections to import into reports and automatically connect to production?

 

Thanks.

1 ACCEPTED SOLUTION
manvishah17
Solution Supplier
Solution Supplier

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 

View solution in original post

2 REPLIES 2
manvishah17
Solution Supplier
Solution Supplier

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 

Shashankgodala
Frequent Visitor

Unfortunately, there is no easy way to change the data source to power BI reports as of now without Fabric subscription. 

If both your Test and Production workspaces are assigned a fabric capacity, you can create a deployment pipeline in Power BI service. 

It lets you change data sources and parameters for each stage of deployment. 

 

https://learn.microsoft.com/en-us/fabric/cicd/deployment-pipelines/get-started-with-deployment-pipel... 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.