Forum Discussion
chris_jones
6 years agoNew Member
Counting three text value in a column
Hi, I have one expression that works for only one value but having issues trying to expand it for three. Example - That works for just counting how many times APPLE is listed in the Fruit Col...
- 6 years ago
Hi chris_jones - use the OR command or the || method
Total Count = CALCULATE ( COUNTROWS ( 'MyData' ), OR('MyData[Fruit] = "APPLE", OR('MyData[Fruit] = "PEAR", 'MyData[Fruit] = "PLUM"))) Total Count = CALCULATE ( COUNTROWS ( FILTER( 'MyData' ), 'MyData[Fruit] = "APPLE" || 'MyData[Fruit] = "PEAR" || 'MyData[Fruit] = "PLUM"))Either of those should work.
Hope this helps
David
amitchandak
Super User
6 years agoTotal Count = CALCULATE ( COUNTROWS ( 'MyData' ), 'MyData[Fruit] in { "APPLE","PEAR","PLUM" } )