Forum Discussion

at0kun's avatar
at0kun
Regular Visitor
8 years ago
Solved

Create Measure for Distinct Count of a column based on criteria from another column

I am trying to create a measure so I can get a unique count of events I am tracking across multiple email campaigns.   In my data I have a column for: Email ID and one for Event Type. I often get d...
  • v-xjiin-msft's avatar
    8 years ago

    at0kun

     

    In your scenario, when Event Type = X you want to return a distinct count of email IDs. Right?

     

    Then you can try following DAX expression for a measure:

     

    Count Event Type X =
    CALCULATE (
        DISTINCTCOUNT ( Table4[Email ID] ),
        FILTER ( ALL ( Table4 ), Table4[Event Type] = "X" )
    )

    Result shows like: 

     

    If above doesn't satisfy your requirement, please kindly share us more information like your source table structure and some sample data with corresponding desired result. So that we can make proper tests.

     

    Thanks,
    Xi Jin.