Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
csommerman
New Member

How to add a parameter in PowerBI to run against a SQL Stored Procedure

How to add a parameter in PowerBI to run against a SQL Stored Procedure

1 ACCEPTED SOLUTION
aduguid
Super User
Super User

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"

 

View solution in original post

1 REPLY 1
aduguid
Super User
Super User

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"

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors