Forum Discussion

Antonio195754's avatar
Antonio195754
Helper IV
6 years ago
Solved

Trying to write an IF statement using OR

Greetings,

 

I'm trying to write a statement for a column that shows 3 types of values: Complete, Not Complete, Not Assigned.

 

I need both "Complete" OR "Not Assigned" to return a "0", else "1".

 

I can write =if('Database'[Column]="Complete","0","1")) And that returns a 0 anytime it shows complete.  What i can't get in one statement is for it to return a zero if it sees "Complete" or "Not Assigned" in the column.

 

Is that possible?

  • Hi,

    Try this calculated column formula

    =if(OR('Database'[Column]="Complete",'Database'[Column]="Not Assigned"),0,1)

    Hope this helps.

4 Replies

  • Hi,

    Try this calculated column formula

    =if(OR('Database'[Column]="Complete",'Database'[Column]="Not Assigned"),0,1)

    Hope this helps.

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion
    Column = if('Database'[Column]="Complete" || 'Database'[Column]="Not Assigned","0","1"))
    • Antonio195754's avatar
      Antonio195754
      Helper IV

      Greg_Deckler This method also worked for me.  all my visuals that hinged to that missing link then worked.  thanks so much

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion
        Yeah, they are equivalent. I just find the || and && easier because as I am thinking through the logic, that's how I think, if this or that... not "if well let's see it will be this or that so I need to start with OR".

        Rubbish!! 🙂