The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
How to add a parameter in PowerBI to run against a SQL Stored Procedure
Solved! Go to Solution.
Make sure you save your parameters as text not numbers.
Then if you use the format below in M you should be able to pass the values to your stored procedure.
let
Source = Sql.Database("YOUR_SERVER", "YOUR_DATABASE", [Query="EXEC [dbo].[Your_Stored_Procedure] " & Text.From(ParameterStoredAsText1) & ", " & Text.From(ParameterStoredAsText2) & ";"])
in
#"Added Index"
Make sure you save your parameters as text not numbers.
Then if you use the format below in M you should be able to pass the values to your stored procedure.
let
Source = Sql.Database("YOUR_SERVER", "YOUR_DATABASE", [Query="EXEC [dbo].[Your_Stored_Procedure] " & Text.From(ParameterStoredAsText1) & ", " & Text.From(ParameterStoredAsText2) & ";"])
in
#"Added Index"
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
182 | |
81 | |
64 | |
46 | |
38 |