Forum Discussion

Fragnatic's avatar
Fragnatic
Frequent Visitor
9 years ago
Solved

Count value pairs in different columns

Hello folks, i have a question regarding the identification and count of value pairs in different colums. My table looks like this: timestamp         message id     device 1483382200   ...
  • Anonymous's avatar
    Anonymous
    9 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] )
    )
    - 1

    Note 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.