Forum Discussion

maxitom's avatar
maxitom
Frequent Visitor
3 years ago
Solved

Sum top N RankX

Hello everyone, I have a file with different categories (animals), for each categories many values with different numbers (number of animals). First I have created a Sum Measure :     Total Nu...
  • AlexisOlson's avatar
    3 years ago

    You need to iterate over the animals so that [Rank] will work like you expect.

     

    Try this:

    Top 3 Value =
    SUMX (
        VALUES ( 'Number of animals'[Animal] ),
        IF ( [Rank] <= 3, [Total Number], 0 )
    )
    
    Other Value = 
    SUMX (
        VALUES ( 'Number of animals'[Animal] ),
        IF ( [Rank] > 3, [Total Number], 0 )
    )