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

Slicer selected value should be pass to query parameter

I have one slicer which contain list of city names whenever i selected the cityname the slicer value need to be passed to the SQL store procedure which will give some result.

My Plan: Slicer value-->Paramater value--> Calling store procedure in M Language(query advance editor)

 

Please could you let me know how we can pass slicer value to parameter value or slicer value in M language(query advance editor)

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

The data in SQL Server data source cannot be filtered by the values in the slicer. But you can filter the data by changing the parameters.


First create a query parameter and list all city values. 

image.png

 

Refer to https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/  

https://www.c-sharpcorner.com/article/execute-sql-server-stored-procedure-with-user-parameter-in-power-bi/ 

to filter the data source. 

 

image.png

 

 

Set different parameter values in Desktop:

 

image.pngUntitled picture (2).png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

Anonymous
Not applicable

My list of parameter value will be dynamically changed and i cannot hardcode the values. I am using sql server live connection.

Hi @Anonymous ,

 

The SQL Server datasource only supports import and direct query mode. Are you using the live connection mode to connect to the published SQL Server dataset?

 

In addition, in live connection, you cannot and do not need to use query parameters. Because when an interaction occurs, the query is sent directly to the data source. So when you use a slicer, Power BI will filter data in the datasource based on the value of the slicer.

 

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

 

 

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