Forum Discussion

Marlonrb's avatar
Marlonrb
Frequent Visitor
10 years ago
Solved

IF - OR Formula in Add Custom Column

I'm trying to use the IF function with OR operation in custom formula for new column but I'm not sure about the correct syntax or rules to include this new logic.   If I use only the IF function it...
  • curth's avatar
    10 years ago

    The "or" has to be lower-case:

     

    let
        a = Table.FromColumns({{"B04", "B09", "B10"}}, {"Cat14"}),
        b = Table.AddColumn(a, "Calc",
            each if ([Cat14]="B04" or [Cat14]="B03") then "GRP1"
            else if ([Cat14]="B05" or [Cat14]="B09") then "GRP2"
            else "Geral")
    in
        b