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
Anonymous
Not applicable

Setting up Parameter in Query on Power BI desktop

Hey, I am trying to create a Client parameter in my dataset, that when you change the client name on the parameter, all the tables update to only have the data for that client.  I created a server parameter and a client parameter. so P_Server & P_Client. Below is the query. This is actually using server views rather than tables, so not sure if that matters.   

 

(I made a post already, but it was marked as spam, so not even sure if actually posted. )

 

 

let
Source = Sql.Database(""&P_Server&"", "DW_Target", [Query="select *#(lf)from Table.Table#(lf)WHERE [Client]="&P_Client&""])



in
Source

 

 

However I keep getting the following error:

 

DataSource.Error: Microsoft SQL: Incorrect syntax near the keyword 'from'.
Details:
Message=Incorrect syntax near the keyword 'from'.
ErrorCode=-2146232060
Number=156
Class=15

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @Anonymous , Your code looks fine there. Does the &_Client& parameter have single quotes in the parameter itself? As they need to be there.

 

View solution in original post

2 REPLIES 2
davehus
Memorable Member
Memorable Member

Hi @Anonymous , Your code looks fine there. Does the &_Client& parameter have single quotes in the parameter itself? As they need to be there.

 

Anonymous
Not applicable

Thanks for the reply. Yes I caught that afterwards and that fixed the problem. The missing single quotes.  Thanks again.. 

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!

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.

Top Solution Authors