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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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