Forum Discussion

amilecki's avatar
amilecki
Frequent Visitor
9 years ago
Solved

RANKX Always Returns 1

I am trying to learn the RANKX expression using a couple examples on the web but every row returns 1.  I have found a couple suggested solutions, none of which have worked for me.   I have simplifi...
  • Sean's avatar
    Sean
    9 years ago

    amilecki

    If you do want to use a Rank Measure in the Visual Filter you have to adjust how the sum is calculated like this...

    Rank Product = 
    RANKX ( ALL(MyData[Product] ), CALCULATE ( SUM ( MyData[Quantity] ), ALLEXCEPT(MyData, MyData[Product] ) ) )

    See below...

    Hope this helps! :smileyhappy: