
1. Re: Sorting/Ranking by two measures  case of a tie
kevin flerlage Sep 12, 2019 4:52 PM (in response to Uzair Rafique)Uzair,
I created a sample data source and brought that into a workbook (both are attached). The data looks like the following:
Dimension Value 1 Value 2 A 458 734 B 740 509 C 424 506 D 314 294 E 424 38 F 630 833 etc.
I created two rank calculations, one to rank Value 1 and another to rank Value 2:
@Rank of Value 1
RANK(avg([Value 1]), 'desc')
@Rank of Value 2
RANK(avg([Value 2]), 'desc')
I then created a third calculation called Combined Rank. The combined rank takes the string of the first rank and combines it with the string of the second rank (and I separated them with a dash).
@Combined Rank
STR([@Rank of Value 1]) + '  ' + str([@Rank of Value 2])
This yields values like 1  11, 2  3, 3  19. The first number is the rank of value 1 and the second is the rank of value 2.
Next, place them all on your view. I started with Dimension on Row, Measure Names on Columns, and Measure Values on Text to build a text table like what I've shown below:
Now take your Combined Rank field and place it on Rows in front of Dimension. Then click on the down arrow of the pill then set it to Compute Using "Dimension". This will sort it by that Combined Rank field.
You'll see that there is a tie at 19 for C & E. The tie is broken by the numbers in Value 2 which is reflected in the Combined Rank. 1915 is sorted before 1926.
I hope this helps...and if it does, please mark it as answered. Thanks!
Kevin Flerlage

Rank Workbook.twbx 30.8 KB

Rank Sample Data.xlsx 8.6 KB


2. Re: Sorting/Ranking by two measures  case of a tie
Bryce Larsen Sep 12, 2019 5:05 PM (in response to Uzair Rafique)Someone else had a very similar question earlier in the week.
Began using this function:
RANK(RANK(SUM([Value 1]))1/SUM([Value 2]))
Have a look at this thread to review: if names have same value of VSAT then use Survey received as deciding factor
Best of luck!
Bryce