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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ThinkerAlways
New Member

Expression.SyntaxError: Token Comma expected (Error - any ideas?)

Expression.SyntaxError: Token Comma expected.

 

I am relative new to using PowerBI. I am learning how to query data from a dataset stored in Access Database. 

 

Here is what I am trying to do, there are four columns with numberic data, the four columns are: FISH, GOAT, PORK and BEEF. The script below attempts to comb through the data by asking, if any of the four columns, their data properties is greater than 65, the new column "YesIfGreater65" will populate the word, "Yes" If not, then "No."  Does anyone know why I get the following error? I don't understand.  Thank you much in advance.

 

Expression.SyntaxError: Token Comma expected.

 

PowerQryBI:

 

CheckValues = Table.AddColumn(#"_2015_2022_TACOS", "YesIfGreater65", each [Fish]> 65 [Goat]> 65 [Pork]> 65 [Beef]> 65 then "Yes"
else if [Fish]> 65 [Goat]> 65 [Pork]> 65 [Beef]> 65 then "Yes"
else if [Fish]> 65 [Goat]> 65 [Pork]> 65 [Beef]> 65 then "Yes"
else if [Fish]> 65 [Goat]> 65 [Pork]> 65 [Beef]> 65 then "Yes"
else if [Fish]> 65 [Goat]> 65 [Pork]> 65 [Beef]> 65 then "Yes"
else null, type "No"
)

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You have to string the conditions together with "and if"

 

CheckValues = Table.AddColumn(#"_2015_2022_TACOS", "YesIfGreater65", each if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and  [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else "No", type text)

 

--Nate

View solution in original post

1 REPLY 1
Anonymous
Not applicable

You have to string the conditions together with "and if"

 

CheckValues = Table.AddColumn(#"_2015_2022_TACOS", "YesIfGreater65", each if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and  [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else if [Fish]> 65 and [Goat]> 65 and [Pork]> 65 and [Beef]> 65 then "Yes"
else "No", type text)

 

--Nate

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.