Forum Discussion

pplanch's avatar
pplanch
Regular Visitor
2 years ago
Solved

Aggregating / counting records with DAX using conditions

I have a table showing below.     What I need to do through DAX (measure ... I don't have access to make changes to the underlying data source) is produce a column with a total count for eac...
  • dufoq3's avatar
    dufoq3
    2 years ago

    I did it for you in Power Query in post above, but if you want to create this in DAX here you go:

     

    Hoofdperiode Count = 
    CALCULATE(
        COUNTROWS(tblSicknessData),
        FILTER(
            ALLEXCEPT(tblSicknessData, tblSicknessData[Naam]),
            tblSicknessData[Reden] = "Hoofdperiode"
        )
    )