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

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
LivioLanzo
Solution Sage
Solution Sage

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!  

View solution in original post

1 REPLY 1
LivioLanzo
Solution Sage
Solution Sage

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!  

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.