Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi all,
I have a table with 2 columns: area and error and need to count rows where area = floor and errors are apple, orange, grapes, and watermelon. I tried using the following which worked well for me in another situation with 2 criteria, but AND doesn't work with multiple criteria:
Solved! Go to Solution.
Hi @scoutmedic
You say you have 1 table but your measure refers to 2 : Error Table and Combined Error Data
You are also referring to 3 different columns but you said you have 2 : [Area], [Category] and [Category Detail]
If you are using 1 table with 2 columns like like this
then this measure will do what you want
Errors = CALCULATE(COUNTROWS('Combined Error Data'), FILTER('Combined Error Data', CONTAINSSTRING('Combined Error Data'[Category], "Floor") && (CONTAINSSTRING('Combined Error Data'[Category Detail], "apple") || CONTAINSSTRING('Combined Error Data'[Category Detail], "orange") || CONTAINSSTRING('Combined Error Data'[Category Detail], "grapes") || CONTAINSSTRING('Combined Error Data'[Category Detail], "watermelon"))))
regards
Phil
Proud to be a Super User!
Hi,
Share some data to work with and show the expected result.
Hi @scoutmedic
You say you have 1 table but your measure refers to 2 : Error Table and Combined Error Data
You are also referring to 3 different columns but you said you have 2 : [Area], [Category] and [Category Detail]
If you are using 1 table with 2 columns like like this
then this measure will do what you want
Errors = CALCULATE(COUNTROWS('Combined Error Data'), FILTER('Combined Error Data', CONTAINSSTRING('Combined Error Data'[Category], "Floor") && (CONTAINSSTRING('Combined Error Data'[Category Detail], "apple") || CONTAINSSTRING('Combined Error Data'[Category Detail], "orange") || CONTAINSSTRING('Combined Error Data'[Category Detail], "grapes") || CONTAINSSTRING('Combined Error Data'[Category Detail], "watermelon"))))
regards
Phil
Proud to be a Super User!
Hi Phil,
Error Table should be Combined Error Data. Missed renaming that one for the example.
You were spot on with the table. There is other fruit on the floor I don't want to count which is why I was going this route. I'll give it a shot and see what happens.
@PhilipTreacy This worked. If I wanted to modify it to look for items in floor and hall that were not apple, orange, or grape?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 37 | |
| 31 | |
| 27 | |
| 27 |