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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Antonio195754
Helper IV
Helper IV

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?

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

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

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

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


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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

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!! 🙂


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

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

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.