cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chotu27 Member
Member

Execute SQL Server stored procedure input parameters with power bi parameters

Hi All,

 

I have stored procedure in SQL Server which i need to bring the data in to Power BI. For that i have to pass two parameters which i wanted to pass with parameters defined in Power BI.

 

Can anyone tell me how to do this it is very much important for my project?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Execute SQL Server stored procedure input parameters with power bi parameters

Hi @chotu27 

 

this is actualy pretty easy, once you have set up both parameters, in my case named CustomerID and ShipperID, just run the query with this M code:

 

=Sql.Database("server_name", "database_name", [Query="exec test_proc " & CustomerID & ", " & ShipperID])

 

 

 

Capture.PNG

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

1 REPLY 1
Super User
Super User

Re: Execute SQL Server stored procedure input parameters with power bi parameters

Hi @chotu27 

 

this is actualy pretty easy, once you have set up both parameters, in my case named CustomerID and ShipperID, just run the query with this M code:

 

=Sql.Database("server_name", "database_name", [Query="exec test_proc " & CustomerID & ", " & ShipperID])

 

 

 

Capture.PNG

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!