Forum Discussion

njxfoster's avatar
njxfoster
Icon for Helper I rankHelper I
4 years ago
Solved

How to If text column CONTAINS specified value, Then Count it

Hi Everyone,

 

I'm trying to create a calculated measure in one of my tables that help me count every column that contains the word "Warm".

 

How can I implement CALCULATE(COUNTROWS to achieve this function? 

 

 

Thank you!

  • njxfoster,

     

    Try this measure:

     

    Warm Count = 
    CALCULATE (
        COUNT ( Table1[Label] ),
        FILTER ( Table1, CONTAINSSTRING ( Table1[Label], "Warm" ) )
    )

     

    Data:

     

     

    Result:

     

     

1 Reply

  • njxfoster,

     

    Try this measure:

     

    Warm Count = 
    CALCULATE (
        COUNT ( Table1[Label] ),
        FILTER ( Table1, CONTAINSSTRING ( Table1[Label], "Warm" ) )
    )

     

    Data:

     

     

    Result: