Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
67 | |
51 | |
38 | |
26 |
User | Count |
---|---|
89 | |
52 | |
45 | |
39 | |
38 |