The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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"