Forum Discussion

jb123's avatar
jb123
Frequent Visitor
9 years ago
Solved

How to create a calculated column with multiple conditions?

I need to create a column based on values in different columns.  I can easily create a rule for the column if the value in either column is true or false.   Here is what I have for the query:   = T...
  • MarcelBeug's avatar
    9 years ago

    You are close. & must be and.

     

    = Table.AddColumn(#"Renamed Columns", "EDU_NP", each if [IsEDU] = true and [IsNonProfit] = true then "EDU/NP" else if [IsEDU] = true then "EDU" else if [IsNonProfit] = true then "HP" else null)

    Remark: if all fields have true/false values (no other values or nulls), then you can omit the "= true"'s.