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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Dynamic database use

Hi All

 

I have 15 reports and each report contains 5 tables. Also, I am 2 DBs in the SQL (DEV & UAT). For testing purpose, I want to connect all PowerBI reports with UAT and later on will change with "DEV" DB. 

 

So, for this, I have created 1 table in SQL where I am storing what is current DB should active for all report. However, I am not able to pass this "DB Name" as parameter in DB connection.

 

Please suggest, how I can achieve this.

 

Kind Regards

Ashwani

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

You could try to create parameters to connect to the data sources.

1. Create in Query Editor

In Query EditorIn Query Editor

2. When connect to SQL Server, change text to parameters.

Connect to SQL ServerConnect to SQL Server

3. When you want to change database, choose to edit parameters.

In Query EditorIn Query EditorIn report viewIn report view

For more details, you could reference the blog :

 https://www.red-gate.com/simple-talk/sql/bi/power-bi-introduction-working-with-parameters-in-power-bi-desktop-part-4/

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

You could try to create parameters to connect to the data sources.

1. Create in Query Editor

In Query EditorIn Query Editor

2. When connect to SQL Server, change text to parameters.

Connect to SQL ServerConnect to SQL Server

3. When you want to change database, choose to edit parameters.

In Query EditorIn Query EditorIn report viewIn report view

For more details, you could reference the blog :

 https://www.red-gate.com/simple-talk/sql/bi/power-bi-introduction-working-with-parameters-in-power-bi-desktop-part-4/

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.