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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
pperumal
Frequent Visitor

Pass slicer filter to the SQL Server DB - Direct Query Mode

Hi,

 

Is it possible to pass the slicer value from power BI as a parameter to a SQL stored procedure ?

 

Thanks in Advance!

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @pperumal 

 

You may try the method introduced in this blog: Chris Webb's BI Blog: TSQL Table-Valued Functions And Dynamic M Parameters In Power BI DirectQuery

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

 

View solution in original post

7 REPLIES 7
v-jingzhang
Community Support
Community Support

Hi @pperumal 

 

You may try the method introduced in this blog: Chris Webb's BI Blog: TSQL Table-Valued Functions And Dynamic M Parameters In Power BI DirectQuery

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

 

Note the article says "You can only hard-code the values you pass to the function’s parameters at this point...."

 

That might be useful for parameter values like days of the week or months, but if you're using a slicer for date ranges, names, or anything dynamic this solution isn't really practical.

TomMartens
Super User
Super User

Hey @pperumal , the feature you are looking for is called dynamic M query parameters for direct query: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters?WT.mc_id=...

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
gzsedely
Frequent Visitor

This could also be the input parameter of the stored procedure!

For example, in the SQL script of the SQL server connector!

Hey @gzsedely ,

I do not think that direct query is supporting calling stored procedures.

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Indeed, you are right!

How do i pass the slicer filters as a input parameter to the stored procedure in the Direct Query. Could you please share any blog or notes available.

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.