- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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"
)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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
Subject | Author | Posted | |
---|---|---|---|
04-26-2024 08:34 AM | |||
Anonymous
| 09-14-2022 04:50 AM | ||
06-30-2020 07:30 AM | |||
Anonymous
| 02-01-2022 01:26 AM | ||
Anonymous
| 05-19-2022 11:05 PM |
User | Count |
---|---|
30 | |
26 | |
24 | |
13 | |
10 |
User | Count |
---|---|
24 | |
23 | |
18 | |
12 | |
9 |