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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Naverie
Helper I
Helper I

Stored Procedure

Hi,

 

I've been following the below link to get a SP into Power BI with parameters and managed to get so far but when invoking I'm getting this error message:

Naverie_0-1629809517277.png

 

I've looked at the query and can't for the life of me see where this error is. I'm sure it's very obvious so any help would be greatly appreciated.

 

let
SQLSource = (SiteId as number, Location as text, Retailer as text) =>
let
Source = Sql.Database("NAV17-DR2", "PW-Reports", [Query="EXEC [planning].[Supply and Demand Extra Day - Report Data '" & Number.ToText(SiteId) & "', '" & (Location) & "','" & (Retailer) & "' #(lf)#(lf)#(lf)#(lf)#(lf)#(lf)"])
in
Source
in
SQLSource

 

https://www.c-sharpcorner.com/article/execute-sql-server-stored-procedure-with-user-parameter-in-pow... 

 

Thanks in advance

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

It looks like you are missing the closing square bracket at the end of your stored procedure name.

 

eg.

 

let
SQLSource = (SiteId as number, Location as text, Retailer as text) =>
let
Source = Sql.Database("NAV17-DR2", "PW-Reports", [Query="EXEC [planning].[Supply and Demand Extra Day - Report Data] '" & Number.ToText(SiteId) & "', '" & (Location) & "','" & (Retailer) & "' #(lf)#(lf)#(lf)#(lf)#(lf)#(lf)"])
in
Source
in
SQLSource

View solution in original post

2 REPLIES 2
d_gosbell
Super User
Super User

It looks like you are missing the closing square bracket at the end of your stored procedure name.

 

eg.

 

let
SQLSource = (SiteId as number, Location as text, Retailer as text) =>
let
Source = Sql.Database("NAV17-DR2", "PW-Reports", [Query="EXEC [planning].[Supply and Demand Extra Day - Report Data] '" & Number.ToText(SiteId) & "', '" & (Location) & "','" & (Retailer) & "' #(lf)#(lf)#(lf)#(lf)#(lf)#(lf)"])
in
Source
in
SQLSource

Thank you. I realised this shortly after posting but didn't get chance to come back and say!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.