Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
Can anybody help with this problem?
Thanks and regards
Solved! Go to Solution.
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
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.
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
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.
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.
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)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.