Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Distinct count based on another column

I have a table, which contains column name IDNR and other columns, I want to count IDNR based on column TYPE, where TYPE= ABC.

  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous 

     

    Measure 2 = CALCULATE(DISTINCTCOUNT('Table'[IDNR]),'Table'[Type]="ABC")

     

     do you want to count number of rows where type= "ABC"? 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

     

    I think you mean the TYPE column contains A, B, C. 

     

    Result = CALCULATE(DISTINCTCOUNT('Table'[IDNR]),ALLEXCEPT('Table',Table[TYPE]))

     


    Best,
    Paul

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

     

    Measure 2 = CALCULATE(DISTINCTCOUNT('Table'[IDNR]),'Table'[Type]="ABC")

     

     do you want to count number of rows where type= "ABC"?