Forum Discussion

Jos13's avatar
Jos13
Icon for Helper III rankHelper III
6 years ago
Solved

RANKX not working as expected

Hi All,

I have a measure to rank staffs based on sales as follows :

Rank_Sales =
RANKX(ALLSELECTED('Table'[Staff]),[Sales_],,DESC)
I also have a month filter. When I filter a month for example August, I could see staffs who hadn't worked on that month.
Here Dave & Steve have not worked on August. Please tell me why is this happening & how can we solve it.
  • Hi Jos13 ,

     

    The Rank is working correctly, the users with no sales are ranked last, makes sense to me. what you need to do is exclude them from the rank function

    like so

    Rank_Sales = if(sum('Table'[Sales]) <> BLANK(), RANKX(ALLSELECTED('Table'[Staff]),[Sales_],,DESC), BLANK())

     

    Hope this Helps

    Richard


    Did I answer your question? Mark my post as a solution!
    Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up! 

4 Replies