Forum Discussion
How can I call a stored procedure in SQL Statement
In Ssrs, we can call a stored procedure with dynamic parameters,
EXEC usp_Client_Day @Start, @End, @MainCLient, @Client, 'CS,COS','NPG'
Quetion? How do you call a stored procedure with dynamic parameters in powerbi sql statement similar to the above code?
Thanks. I guess by default i should just create the data range parameter within sql statement and create the other parameters in powerbi visual.
6 Replies
- IdrissshatilaSuper User
Hello akosiRandy ,
Power bi doesn't support stored procedures, you must create it as a view and then connect to it through Power BI.
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- akosiRandyFrequent Visitor
Thanks. I guess by default i should just create the data range parameter within sql statement and create the other parameters in powerbi visual.
- marcelsmaglhaesSuper User
Hey akosiRandy
Take a look into this link: Power BI. Execute SQL Server stored procedure with a user parameter - Stack Overflow
Regards,
Marcel - ThxAlotSuper User
= Value.NativeQuery( Sql.Database("SqlSvr", "db"), "EXEC usp_Client_Day", {@Start, @End, @MainCLient, @Client, "'CS,COS'","'NPG'"} )- akosiRandyFrequent Visitor
Thanks. Do you enter that code in SQL Statement dialog?