Forum Discussion

Stoo48's avatar
Stoo48
Frequent Visitor
9 years ago
Solved

COUNTIFS Functionality in DAX

Trying to find a DAX equivilent to:   ACTIVITY =COUNTIFS([fault_code],[@[fault_code]],[equipment_id],[@[equipment_id]])   Have experimented with COUNT and CALCULATE but can't find a syntax that w...
  • v-sihou-msft's avatar
    v-sihou-msft
    9 years ago

    Stoo48

     

    According to your description, you want to count rows which meet the criteria. Right?

     

    You can create a measure like below:

     

    COUNTIFS =
    CALCULATE (
        COUNTROWS ( Table ),
        FILTER (
            Table,
            Table[fault_code] = fault_code1
                && Table[equipment_id] = equipment_id1
        )
    )

    Regards,