Forum Discussion
maxitom
3 years agoFrequent Visitor
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...
- 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 ) )
AlexisOlson
Super User
3 years agoYou 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 )
)- maxitom3 years agoFrequent Visitor
Thank you very much for your time, it's working well. It will help me to create my future measures and understand better PBI.