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
dedelman_clng
Community Champion
6 years agoHi 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
- chris_jones6 years agoNew Member
Thank you dedelman_clng