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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jyotmishra15
New Member

Please help!! Need to pass server name and database name slicer values to Parameters in power bi

Hello Everyone, my first question here 🙂

 

I have a query which give tables space (size) details in a database on a server. We have got many databases under that server.

Now, in Power BI, the SQL query takes servername and db name as parameters in connection details. I would like to pass the db name and server name from a slicer to the connection parameters of the sql query, so that the query returns the table space information based on the slicer values selected of server name and dbname.

 

I tried implementing that but its not working. Please guide.

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @jyotmishra15 

 

I’m afraid that the values of a slicer are not able to be passed to the connection parameters of a sql query currently. When using Power BI, the working logic is first connecting to data in data sources where connection info is used. Then you may perform some data transformation work in Power Query Editor. After applying all the changes in Query Editor and go to Power BI desktop, you can create reports by using visualizations and measures, etc. So when you use a slicer, it interacts with data from an established fixed data source connection and cannot change data source at this report layer dynamically.

 

I created a parameter Database in Power Query Editor and load it to Desktop to check its value. As shown below, it only contains its current value rather than the value list.

v-jingzhang_0-1602832230331.jpeg

 

So you may consider generating the details as well as server names & db names into a new table or view at your database side in advance if possible. Then get data from this table in Power BI and put server names & db names fields into a slicer.

 

Additionally, reference for differences between power query parameters and what if parameters: 

https://radacad.com/power-query-parameters-vs-what-if-parameters-power-bi-implementation-use-cases

 

Best Regards,

Community Support Team _ Jing Zhang

If this post helps, please consider Accept it as the solution to help other members find it.

Anonymous
Not applicable

@jyotmishra15 - Check the below if this can help you.

https://spr.com/powerbi-dynamic-calculations/#:~:text=Parameters%20provide%20a%20mechanism%20to,refe....

 

Appreciatre your kudos!! Mark my post as solution if this helps.

amitchandak
Super User
Super User

@jyotmishra15 , I doubt you can use the slicer. Check if this can work -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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.