Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Ranking Non-Numerical Data

I'm having trouble ranking information that does not have numerical data columns in the data set.  I need to count a list of items and be able to rank them among the total count of data set.  For example, I have 10 items and the row breakdown will look something like this:

 

Label

A

A

B

C

A

A
B

C

C

A

 

I need to be able to show the result similar to this.

 

A - 5 rank 1

B - 2 rank 3

C - 3 rank 2

 

Since the count is not a data column, I'm having difficulty figuring out how to utilize the RANKX function.  Any help would be greatly appreciated.  Thanks!

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion
    Measure = 
    VAR __Label = MAX([Label])
    VAR __tmpTable = SUMMARIZE(ALL('Table1'),[Label],"__Count",COUNT(Table1[Label]))
    VAR __tmpTable1 = ADDCOLUMNS(__tmpTable,"__Rank",RANKX(__tmpTable,[__Count],,DESC))
    RETURN MAXX(FILTER(__tmpTable1,[Label]=__Label),[__Rank])