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 September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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