Forum Discussion
Count value pairs in different columns
- Anonymous9 years ago
Correct - the ALLEXCEPT function is ignoring all filters except the row context for [timestamp]
You can allow a filter by Message[device] by adding it to the ALLEXCEPT:
Duplicate Message IDs = CALCULATE ( DISTINCTCOUNT ( Messages[message id] ), ALLEXCEPT ( Messages, Messages[timestamp], Messages[device] ) ) - 1Note that the filter/slicer must be on Messages[device] - if you want to filter on [device] from a related dimension table, that would likely change the approach required.
Does this variation on the measure from ImkeF work for you:
Duplicate Message IDs =
CALCULATE (
DISTINCTCOUNT ( Messages[message id] ),
ALLEXCEPT ( Messages, Messages[timestamp] )
)
- 1Thank you very much Anonymous, this is exactly what i needed.
I spent hours trying to figure this out.
It works perfectly if i use a filter to specify a timestamp. It also works without a filter at all.
But it seems that i can't filter by device any more, probably because of the ALLEXCEPT function.
Is there even a way to filter this measure by device?
Many thanks again!
- Anonymous9 years agoNot applicable
Correct - the ALLEXCEPT function is ignoring all filters except the row context for [timestamp]
You can allow a filter by Message[device] by adding it to the ALLEXCEPT:
Duplicate Message IDs = CALCULATE ( DISTINCTCOUNT ( Messages[message id] ), ALLEXCEPT ( Messages, Messages[timestamp], Messages[device] ) ) - 1Note that the filter/slicer must be on Messages[device] - if you want to filter on [device] from a related dimension table, that would likely change the approach required.
- Fragnatic9 years agoFrequent VisitorThanks again Steve!