Forum Discussion

mb0307's avatar
mb0307
Icon for Responsive Resident rankResponsive Resident
6 years ago
Solved

Ranking - negative or positive

Hi all,   As shown in the example below, I would like to rank the companies by sales variance.  Result should show Top 5 ranking by biggest variance number regardless if it is a -ve or +ve number. ...
  • PaulDBrown's avatar
    6 years ago

    mb0307 

    Use the ABS function to render all values positive and then use that in the RANKX measure. (Or new column)

    This blog post may help (if you wish to display the actual rank):

    Reversing the Y-Axis for ranks 

  • mb0307's avatar
    mb0307
    6 years ago

    Rankx(all(Table[compnay]), calculate(abs(sum(table[sales variance]))),,asc,dense)

     

    by adding ABS function it gives the desired output. 

     

    Thanks