Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Ranking Not Working Properly

Hi guys Need help before I pull all my hair out The ranking works fine for everything except for the red circled, it should be 1 instead of 2 Sales Rank = IF ( ISINSCOPE ( 'Product'[Prod...
  • jdbuchanan71's avatar
    6 years ago

    That is very odd behavior, I can only think that it has something to do with [Product Category] "Fuses" have a sales amount larger than the #2 ranked [Product Line].  

    However, switching it to to using HASONEVALUE seems to fix it.

    Ranking = 
    IF ( HASONEVALUE ( 'Product'[Product Category] ),
        RANKX ( ALL ( 'Product'[Product Category] ), [Sales Amount] ),
        IF ( HASONEVALUE ( 'Product'[Product Line] ),
            RANKX ( All ( 'Product'[Product Line] ), [Sales Amount] )
        )
    )