RANKX and ISINSCOPE

 RankOnSale =

IF (
ISINSCOPE ( Products[Product] ),
RANKX (
ALLEXCEPT ( Products, Products[Category] ),
[SumOfSales]
),
IF (
ISINSCOPE ( Products[Category] ),
RANKX (
ALLSELECTED ( Products[Category] ),
[SumOfSales]
)
)
)


Comments

Popular posts from this blog

Difference between DISTINCT and VALUES in DAX