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
praveenk
Frequent Visitor

How to pass parameter value dynamically to sql server store procedure

Hello Everyone,

 

Is there any possible way like, pass parameter value dynamically to my direct query (SP) and data has to be refershed to based on the given i/p parameter. With the current setup, I had to edit the parameter values every time on the pbi desktop to fetch the data from the source. Want to avoid this manual step and looking to provide a kind of dynamic functionality where users can pick a date from the slicer and those selected values had to pass on to the source for the latest data. Few of them in this group might face this issue and figure out a solution, appreciate any thoughts or ideas.

 

Thanks,

Praveen

2 REPLIES 2
amitchandak
Super User
Super User

@praveenk , Dynamic M parameters can help. But not sure if that is supported on SQL Server SP

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak -  Sorry for getting back to you late. I've been trying to run a direct query, but I keep getting an error. I checked out some posts in the community, but I still can't figure out the right syntax.

 

Syntax: EXEC [dbo].[SP NAME] @StartDate = '04/15/2023', @EndDate = '04/16/2023',

 

EXECUTE [dbo].[SP NAME] @StartDate = '04/15/2023', @EndDate = '04/16/2023'

praveenk_0-1683647636655.png

 

 

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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