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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ninsights
Helper III
Helper III

What is the shortened formula for "if A or B or C or D or ...."

Hello all:

 

I know this must be easy in Power BI, but I can't seem to find the formula to do a large number of OR checks in my formula. Here's my situation.

 

I have a table containing data for 1000 part numbers. Let's pretend it looks like this:

 

PartNumber 

00001             

03756

17453 ... etc.

 

I would like to create a column based on a formula that says "If PartNumber is "44001" or "44032" or "68453" or... (for 34 specific part numbers)" then "Yes" else "No."

 

My challenge is that I have 34 PartNumbers that I need the formula to check for so that those 34 are "yes" in the new column and all others are "no."

 

What is the shortened formula to check if the PartNumber is in ("44001","44032","68453",...) without having to type 34 OR conditions?

 

Thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Create column = IF(table[Part_number] in {10000,12245,...... so on},"YES","NO")

 

Incase your part number is in sequence then use

 

column = IF(table[Part_number]>=10000 && table[Part_number]<=10034 ,"YES","NO")

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Create column = IF(table[Part_number] in {10000,12245,...... so on},"YES","NO")

 

Incase your part number is in sequence then use

 

column = IF(table[Part_number]>=10000 && table[Part_number]<=10034 ,"YES","NO")

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

 

 

Thank you very much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.