Forum Discussion

jay13's avatar
jay13
Regular Visitor
1 year ago
Solved

Countrows with filters

I am trying to count the rows for an ID where they only have a specific code.   Example: If I am looking to count the IDs that only have code D how would I count just that row. In this case the cou...
  • Gabry's avatar
    1 year ago

    Hello jay13 

     

    this is your measure

    ContaSoloD =
    CALCULATE (
        DISTINCTCOUNT ( Tabella[ID] ),
        FILTER (
            VALUES ( Tabella[ID] ),
            CALCULATE ( COUNTROWS ( FILTER ( Tabella, Tabella[code] <> "D" ) ) ) = 0
        )
    )

    let me know if it works