Forum Discussion

chris_jones's avatar
chris_jones
New Member
6 years ago
Solved

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...
  • dedelman_clng's avatar
    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