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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Frequent Visitor

How to pass parameter to stored procedure depending upon the selection from a dropdown?

Hi All,


I am looking into a way of passing a selected element (from a drop down) to stored procedure as a parameter.

(means the stored procedure will execute on the change drop down element action).


How I can achieve this?


I am calling a stored procedure like:

    Source = Sql.Database("mydatabaseinstance", "AdventureWorks2012", [Query="DECLARE @SP VARCHAR(100) = 'dbo.uspGetEmployeesByJobTitle @JobTitle = ''Senior Tool Designer'''#(lf)EXEC (@SP)"])

from here.




I have also gone through this behavior of  calling a stored procedure by passing parameters.


but I believe.... through this way, we can achive different results on the Queries side..... not on the actual Reports side because they are not runtime parameters.

(So this behavior is not suitable in what I want).





Not applicable

Hello @azizimranz,


I am came across the  same proble, Need a parameter of SP from the  user as drop down list like as SSRS rport.


Unfortunatliy we  have  to laod all the data then we can apply the filter.


Thank You


Hi @azizimranz,


If you were attempting to pass selected value from slicer to stored procedure as a parameter, this is not available. It is not supported to pass slicer selection to Power Query. To dynamically change dataset loaded into desktop, we have to use query parameter as you mentioned above.


through this way, we can achive different results on the Queries side..... not on the actual Reports side because they are not runtime parameters.


Editing the parameter value, both query side and report side will be changed. 



Best regards,
Yuliana Gu


Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft


Thanks for the clarification and clearly saying that 'passing a runtime parameter from the slicer is not available'.


I might have to change the stored procedure in a way that it would return all the data and we then filter it down as per the dropdown selection.





Did you ever get this to work, I have the same problem.


Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.