Forum Discussion
amuola
Helper II
8 years agoDistinct count based on a criteria from another column
Hi, I would like to count the number of distinct “Req nr” that has not got any “Book nr” at all. Each row in the Table corresponds to a certain activity in the process, and at some time the Req n...
- 8 years ago
Hi amuola,
You could add below measure to a card visual to show result.
DistinctCount = CALCULATE ( DISTINCTCOUNT ( 'Book record'[Req nr] ), FILTER ( ALL ( 'Book record' ), CALCULATE ( COUNT ( 'Book record'[Book nr] ), FILTER ( ALLEXCEPT ( 'Book record', 'Book record'[Req nr] ), 'Book record'[Book nr] <> BLANK () ) ) = BLANK () ) )Best regards,
Yuliana Gu
v-yulgu-msft
Microsoft Employee
8 years agoHi amuola,
You could add below measure to a card visual to show result.
DistinctCount =
CALCULATE (
DISTINCTCOUNT ( 'Book record'[Req nr] ),
FILTER (
ALL ( 'Book record' ),
CALCULATE (
COUNT ( 'Book record'[Book nr] ),
FILTER (
ALLEXCEPT ( 'Book record', 'Book record'[Req nr] ),
'Book record'[Book nr] <> BLANK ()
)
)
= BLANK ()
)
)
Best regards,
Yuliana Gu
- amuola8 years ago
Helper II
excellent, this works perfect!
Can you please briefly describe the steps?
Regards
Amund
- amuola8 years ago
Helper II
Is it possible to modify the measure so that I can get a distribution over time? Each Req nr has a Req date – the date when the Req nr was generated. The measure gives me the total number of unique Req nr without a book nr (what I wanted), however I would also like to see the numbers over time.
Regards Amund