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! Learn more

Reply
Anonymous
Not applicable

Calling Stored procedure in Power BI with DAX values as parameter

Hi Team , 
I have 5 slicer in my Power BI report. I need to get all the selected value from slicer and concatinate those values in one variable and pass those variable to stored procedure in direct query mode. 
I didn't find any link which suggest these scenario. 
My Stored procedure is dynamic stored procedure. Dynamic Sql written in the stored procedure to get data from linked server.
Please suggest what are steps to call the dynamic stored procedure in direct query mode. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

I need to verify your request, are you asking for the selected value in the slicer as a parameter to the SQL statement? 

 

If so, I'm afraid Power BI does not currently support this.

 

If this is acceptable to you, please refer to the following method: you can create the parameter in Power Query and then reference the parameter in the SQL statement. That is, filter the data directly using the parameters in Power Query.

 

How to create parameters:

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters#add-parameters 

vxuxinyimsft_1-1722568790831.png

 

Referencing Parameters in M query:

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters#reference-the-parameters-in-the-m-query 

 

Best Regards,
Yulia Xu

 

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous 

 

I need to verify your request, are you asking for the selected value in the slicer as a parameter to the SQL statement? 

 

If so, I'm afraid Power BI does not currently support this.

 

If this is acceptable to you, please refer to the following method: you can create the parameter in Power Query and then reference the parameter in the SQL statement. That is, filter the data directly using the parameters in Power Query.

 

How to create parameters:

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters#add-parameters 

vxuxinyimsft_1-1722568790831.png

 

Referencing Parameters in M query:

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters#reference-the-parameters-in-the-m-query 

 

Best Regards,
Yulia Xu

 

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