Forum Discussion

madhav2020's avatar
madhav2020
Frequent Visitor
6 years ago
Solved

Maximum occuring unique value in a column

how to write a query to get maximum occuring unique value and its count in a column ?   Manager Sujith Ajay Joseph Sujith Sujith   In the above table i would like to see answer as sujit-3 as...
  • AlB's avatar
    AlB
    6 years ago

    Hi madhav2020 

    if you prefer to do it in DAX, you can create a  measure and place it in a card visual:

     

    Measure 2 = 
    VAR t_ = ADDCOLUMNS(DISTINCT(Table2[Manager]), "Count_", CALCULATE(COUNT(Table2[Manager])))
    VAR max_ = MAXX(t_,[Count_])
    RETURN 
    CONCATENATEX(FILTER(t_, [Count_] = max_),[Manager]&"-"&[Count_],", ") 

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers