Forum Discussion

Nobuko_ao's avatar
Nobuko_ao
Frequent Visitor
8 years ago
Solved

Countif DAX

HI,   I have a very simple question. On this simple sheet as below, I counted # of ID of <50 score, using countif in excel, as  =COUNTIF(B2:B21, "<50")   How do I manage it in DAX? Many thanks...
  • Zubair_Muhammad's avatar
    8 years ago

    Hi Nobuko_ao

     

    You can use this MEASURE

     

    Measure =
    CALCULATE ( COUNTROWS ( Table1 ), Table1[Score] < 50 )
    

     

    or this one

     

    Measure 2 =
    COUNTROWS ( FILTER ( Table1, Table1[Score] < 50 ) )
    

     

    or this one

     

    Measure 3 =
    COUNTX ( FILTER ( Table1, Table1[Score] < 50 ), 1 )