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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors