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
Anonymous
Not applicable

Filter a table with multiple conditions

Hi all, 

 

I have a table such as : Capture1.PNG

 

And I'd need a column that filters with specific criteria : 

- If it's A or B, lenght has to be min 5

- If it's D, lenght has to be min 4

- If it's C, lenght has to be min 2 

Capture3.PNG

I tried a multiple IF, such as : 

Filtre = if(Table[Class]= "A" || Table[Class]= "B" && Table[Lenght]>5 , 1 ,
if(Table[Class]= "C" && Table[Lenght]>1 , 1 ,
if(Table[Class]= "D" && Table[Lenght]>3 , 1 , ,0)))

 

It doesnt retrieve error, but it doesn't filter correctly. Any ideas? 

Thanks in advance!  

 

Ana 

 

1 ACCEPTED SOLUTION

@Anonymous  Please try this as a "New Column"

 

Filter = IF(Test280MultiIf[Class] IN {"A","B"} && Test280MultiIf[Length]>=5,1,IF(Test280MultiIf[Class]="C" && Test280MultiIf[Length]>=2,1,IF(Test280MultiIf[Class]="D" && Test280MultiIf[Length]>=4,1,0)))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

4 REPLIES 4
PattemManohar
Community Champion
Community Champion

@Anonymous  Could you please confirm the below logic. That means, all the classes should be minimum of length 5. Is that you are looking for ?

 

- If it's A or B, lenght has to be min 5

- If it's D, lenght has to be min 5

- If it's C, lenght has to be min 5 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

sorry, no, my mistake. A & B <5 ; C < 2 and D < 4, i corrected the main question

@Anonymous  Please try this as a "New Column"

 

Filter = IF(Test280MultiIf[Class] IN {"A","B"} && Test280MultiIf[Length]>=5,1,IF(Test280MultiIf[Class]="C" && Test280MultiIf[Length]>=2,1,IF(Test280MultiIf[Class]="D" && Test280MultiIf[Length]>=4,1,0)))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

thanks a lot, it works nicely! 

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.