Forum Discussion
Countrows with filters
- 1 year ago
Simple enough,
You're right. I changed the previous post with the updated formula. Let me know
Thanks Gabry ! Are you able to explain how this is working? I am understanding pieces of it but when we get to the last filter where its <> "D" then =0 I am getting a little lost. I really appriciate the help on this one. Thanks again!
- Gabry1 year agoSuper User
Yeah, sure, I can try. You can use the DAX query view to help debug the code.
This part of the code:
FILTER (
VALUES ( Tabella[ID] ),
CALCULATE ( COUNTROWS ( FILTER ( Tabella, Tabella[code] <> "D" ) ) ) = 0
)filters out all the IDs that have a code different from "D". It essentially says to keep only the rows where the count is 0.
Then, you just count the IDs in this filtered table with:
DISTINCTCOUNT ( Tabella[ID] )
and you'll get the number of IDs.
😉- jay131 year agoRegular Visitor
Thanks so much for the help!