Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Count distinct IDs based on another field

Hello,   I have a large data set where the ID is not distinct, and I want to create a measure to count the IDs per Region.   The table looks like this ID Region 001 APAC 001 APAC ...
  • v-yadongf-msft's avatar
    3 years ago

    Hi Anonymous ,

     

    Please create a new column:

    Count = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table','Table'[Region] = EARLIER('Table'[Region])))

     

    Create a table visual:

     

    Best regards,

    Yadong Fang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.