Forum Discussion
jay13
1 year agoRegular Visitor
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...
- 1 year ago
Simple enough,
Gabry
1 year agoSuper User
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
- jay131 year agoRegular Visitor
thank you for the reply. This seemed to work at first but if I add additional rows it is still only counting one?
Example: It should count 3 since ID's 3,4 and 5 have code D only.
ID code 1 M 1 D 1 L 2 D 2 M 3 D 4 D 5 D