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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.