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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PSan1979
Helper II
Helper II

Executing Stored Proc in Power BI

Hi Experts,

I have a dashboard, the data is populated in the dashboard by stored procedure (SP).  SP contains 3 parameters which need to pass ‘Store Code’,’Date1’,’Date 2’

Is it possible to execute SP on-demand in power bi by giving an option to users to click the button and execute the SP?? Or is there way to handle this problem.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@PSan1979 , see https://www.c-sharpcorner.com/article/execute-sql-server-stored-procedure-with-user-parameter-in-pow...

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

View solution in original post

v-deddai1-msft
Community Support
Community Support

Hi @PSan1979 ,

 

Would you please check if the data type of parameter is the same as it in the sql database?

Capture2.PNG

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

 

Best Regards,

Dedmon Dai

 

View solution in original post

5 REPLIES 5
v-deddai1-msft
Community Support
Community Support

Hi @PSan1979 ,

 

Would you please check if the data type of parameter is the same as it in the sql database?

Capture2.PNG

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

 

Best Regards,

Dedmon Dai

 

amitchandak
Super User
Super User

@PSan1979 , see https://www.c-sharpcorner.com/article/execute-sql-server-stored-procedure-with-user-parameter-in-pow...

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 getting an error

DataSource.Error: Microsoft SQL: Error converting data type varchar to datetime.
Details:
DataSourceKind=SQL
DataSourcePath=desktop-tjk1uhp\san; Test
Message=Error converting data type varchar to datetime.
ErrorCode=-2146232060
Number=8114
Class=16

amitchandak
Super User
Super User

@PSan1979 , refer this old thread

https://community.powerbi.com/t5/Desktop/Use-SQL-Store-Procedure-in-Power-BI/td-p/20269

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  User  to pass parameters (‘Store Code’,’Date1’,’Date 2’) based on the user input we need to execute the SP and fetch data

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.