Forum Discussion

Mkrishna's avatar
Mkrishna
Helper III
2 years ago

RankX not working

Hello,

I am tying to create a Ranking based on the growth but when I use growth meausre to ranking, some rank number is missing. however  when i use another measure TY % LY, the ranking shows all number correct. I am not understanding why this is happening

 

Measure 1

1. June TY = Sum(Sales[TY])
2. June LY = Sum(Sales[LY])
3. TY vs LY % = Divide([June TY], [June LY]) -- this is formatted to % 

4. Growth %

 var x = [June TY] - [June LY]
var y = Divide(x, [June LY)) -- this is also formatted to %
return y

6. Ranking 1 = CALCULATE(RANKX(ALL('Sales)'[Rep]), [TY vs LY %], ,DESC, Dense), REMOVEFILTERS('STATE (Sales)'[STATE]))
7. Ranking 2 = CALCULATE(RANKX(ALL('Sales)'[Rep]), [Growth %], ,DESC, Dense), REMOVEFILTERS('STATE (Sales)'[STATE]))

When I use Measure (6), Ranking 1 in the table view, I get the correct number of raking, there is no missing rank number in the middle. However, when i use Ranking 2 in the table view, I find some of the naking is middle is missing. Like there is no 1..10 then there is 12, rank 11 is missing in the middle.
 
Could anyone explain me why this is happening.

2 Replies

  • Hey Mkrishna ,

     

    please create a pbix that contains sample data, but still reflects your semantic model (tables, relationships, calculated columns, and measures). Upload the pbix to OneDrive, Google Drive, or Dropbox and share the link. If you are using a spreadsheet to create the sample data instead of the manual input method, share the spreadsheet as well.


    At a first glance though, because you are using ALL( column ), even values are ranked that are not in the context of the current visual. Check the result using ALLSELECTED(column).

     

    Regards,

    Tom