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
Anonymous
Not applicable

One Parameter to Change Source for Multiple SQL Data Sources

Hello! I need to figure out a way to easily trigger multiple source changes by using one parameter. Here's the situation: 

 

I have multiple sql datasources coming from a few different databases. Each database has a development and a production version. There is also a development and production Power BI environment. When moving reports from the development environment to the production environment, I would like to be able to make one parameter that can change all the data sources at once AND allows us to refresh the data sources on the report server. I know how to create a parameter to change one of the data bases, but not how to link multiple of these sources together. Basically, I think I'm looking for something like cascading parameters. 

 

Here's what I've tried so far: 

 

Attempt 1: Creating an IF statment as the source for my query. This looked like the below: 

Sql.Database(
       if #"Parameter"="Development" then "Development_DB" else "Production_DB"
       , "Database_Name", ...Query stuff....)

This would not allow refreshes on the server. 

 

Attempt 2: Creating an IF statement for the whole source. This looked like the below: 

if #"Parameter"="Development" then Sql.Database(
       "Development_DB"
       , "Database_Name", ...Query stuff....)
else Sql.Database(
       "Production_DB"
       , "Database_Name", ...Query stuff....)

This required me to enter credentials for both data sources on each site. Not acceptable to our team. 

 

Attempt 3: Creating a blank query and using an IF statment to give it just the value of the required database. The thought here was that I could create a new parameter and assign this table as the value to user in my data sources. (This was my attempt at cascading parameters.) The parameter would not let me select the table as a Query. Table below: 

#table(
 type table
    [
        
        #"Text Column"=text
        
    ], 
 {
  
  {if #"Parameter"="Development" then "Development_DB" else "Production_DB"}  
 }
)

 

Now I'm out of ideas and I haven't been able to google anything to help me out. Has anyone done anything like this before? Any ideas? 

1 REPLY 1
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Seems like 'cascading parameters' only used in Power BI Report Builder to create paginated reports as far as I know:

Use cascading parameters in paginated reports 

 

Parameters in Power Query can change one data source if the type of parameter is list or a single value, change mutilple data sources at the same time with 'cascading parameters' seems not supported.

 

perhaps you can submit the requirement to ideas and add your comments there to make this feature coming sooner: https://ideas.powerbi.com/forums/265200-power-bi-ideas


It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.