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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Parn
Frequent Visitor

Filter multiple condition

Hello everyone,

I have the table shown below. I want to filter for the products which have at least the Material MA1 and MA2.  So the products should be A and E. I was trying to filter with the "and" option but it is not working and returns nothing. 

Parn_0-1676447141347.png

Can anybody help with this problem?

 

Thanks and regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Parn ,

Please try below steps:

1. create a measure with below dax formula

Measure =
VAR cur_product =
    SELECTEDVALUE ( 'Table'[Product] )
VAR tmp =
    CALCULATETABLE (
        VALUES ( 'Table'[Material] ),
        FILTER ( ALL ( 'Table' ), [Product] = cur_product )
    )
VAR _str =
    CONCATENATEX ( tmp, [Material] )
RETURN
    IF ( CONTAINSSTRING ( _str, "MA1" ) && CONTAINSSTRING ( _str, "MA2" ), 1 )

2. add a table visual with fields and add above measure to filter pane

vbinbinyumsft_0-1676603372397.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Parn ,

Please try below steps:

1. create a measure with below dax formula

Measure =
VAR cur_product =
    SELECTEDVALUE ( 'Table'[Product] )
VAR tmp =
    CALCULATETABLE (
        VALUES ( 'Table'[Material] ),
        FILTER ( ALL ( 'Table' ), [Product] = cur_product )
    )
VAR _str =
    CONCATENATEX ( tmp, [Material] )
RETURN
    IF ( CONTAINSSTRING ( _str, "MA1" ) && CONTAINSSTRING ( _str, "MA2" ), 1 )

2. add a table visual with fields and add above measure to filter pane

vbinbinyumsft_0-1676603372397.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sravula
New Member

Answer: Apply "MA1" OR "MA2" as filter on Material field.

Reason: if you using AND operator, power bi will check if both MA1 & MA2 are existing in every single cell or not.

 

Parn
Frequent Visitor

But if use the OR operator is also returns the products which contain either MA1 or MA2 (example: Product B). I just want to have the products which contain MA1 and MA2 (A and E)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors