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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DAPBI
Regular Visitor

Dynamic DB name and Server for SQL Server data source

Hello everyone,

 

An absolute newbie in Power BI so appreciate your help and support on this. 

 

I have SQL Server as a data source.

I am using the below approach and will also explain the requirement so if anything has to be done differently do let me know.

1. I used the Connect -> Sql Server option on the top menu

2. Provided the Db name and Server

3. Selected the "Using DirectQuery" option

4. In Advanced Options provided an SQL statement - For now - Select * from tblName.

5. Click on Load button 

This shows the list of fields on the right.

I dragged a chart control on the Report and the required field from the field list. The chart correctly shows the data from the selected DB, Server and SQL query.

 

But my real challenge and the requirement is to have the DB name and Server dynamic for the Report.

Meaning - I need to have two dropdowns on the Report page - one showing the list of DB names and the other showing list of Server names. I am using the dropdown option of a Slicer control here.

 

When the user selects the Db and Server from the dropdown, the chart should reflect based on the data from that selected DB and Server. The SQL query is always the same.

 

Could you please assist on this.

 

Thanks in advance.

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@DAPBI , refer if this can help

https://radacad.com/change-the-source-of-power-bi-datasets-dynamically-using-power-query-parameters

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak 

 

Thank you for your reply.

I have gone through the entire link. I was aware of the parameters. But it is not user-friendly to always go to the Parameters and edit them. 

 

I already have two dropdowns created out of a Slicer control - 1 shows the Db name and 1 shows the Server.

Is there a way that when a user selects the Db and Server from the dropdowns and the Charts below the dropdowns automically refreshes to the data from that particular Db and Server?

 

Thanks.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors