Forum Discussion

chudson's avatar
chudson
Helper IV
7 years ago
Solved

Using RANKX or DAX measure to creating a ranking based on 2 calculated measures

Hi,

 

I'm hoping someone can help me here with ranking a report visual table.  Below is an example of the data I'm showing as a table visual in a report and I have a rankx function that ranks the districts by % to quota but I want a 2nd ranking measure in here to rank the districts by their QTD Quota # that would break a tie if the % to quota were the same (in this case a lot of the districts with 0 % to quota).

So instead of ranking all Districts in my example as 12, the rank would look at 0% of % to Quota and thank rank by the QTD Quota #.

 

My Rank Column is calculated measure = 

RANKX(ALLSELECTED(DimSalesAgent[DISTRICT]),[% to Quota],,DESC)
 
Also, to note my QTD, QTD Quota, % to Quota are all calculated measures as well.

 

 

RANKDISTRICTQTD SalesQTD Quota% to Quota
1District 1$55,582$50,770109%
2District 2$347,563$187,500185%
3District 3$32,206$87,84437%
4District 4$194,298$223,77987%
5District 5$514,625$490,000105%
6District 6$979,158$1,056,84393%
7District 7$186,375$264,32771%
8District 8$724,728$847,00086%
9District 9$57,059$140,27341%
10District 10$610,496$750,00181%
11District 11$414,430$547,20076%
12District 12$0$10,6130%
12District 13$0$140,0000%
12District 14$0$116,7520%
12District 15$5,400$00%
12District 16$0$119,8340%
12District 17$25,370$00%
12District 18$0$00%
12District 19$0$75,0000%
12District 20$0$186,6780%

 

Thanks!

2 Replies