Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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?
Solved! Go to Solution.
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])
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
This assumes the query is already loaded (M-code interface).
How do you get the query (that calls the stored procedure) loaded in the first place (so that you can use M-code)?
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])
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 56 | |
| 43 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 108 | |
| 44 | |
| 32 | |
| 26 |