Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Issues with rankx

Hello. I have 5 product categories and i want to rank them from 1 to 5 according to their sales but the data integrity is not accurate 100% and I would like to ask for some help.

This is my dax function for the Sum:

SumOrders = CALCULATE(IF(ISBLANK(SUM(FactOrders[Total])), 0, SUM(FactOrders[Total])))
Rankx dax:
Sales Amount Product Category Rank =
RANKX ( ALL ( dimProducts[Category_Name]), [SumOrders],, DESC )
 
Store Rank Text = [Sales Amount Product Category Rank] & " of "   & 5
 this is the full display of the ranks

 

when I will pick components and clothing both of them will have rank 3

 

how can I solve this issue?? Thanks in advance

 

6 Replies