Forum Discussion

kompalli's avatar
kompalli
Icon for Helper I rankHelper I
3 years ago
Solved

Rank in a card

Hi Need Help I was trying to display rank in a card. Below are the details of I am trying to do. Below is the Table I have Company names and sales. One company has different names so I ranked fir...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi kompalli ,

    I updated my sample pbix file(see the attachment), please check if that is what you want. It return 3 not 4, I'm not sure if it is correct or not...

    NIKE Sales Ranking = RANKX ( ALL ( Company ), [Total sales] )
    Measure = 
    VAR _tab =
        SUMMARIZE (
            'Company',
            'Company'[Market/Nike],
            'Company'[Company],
            "@totalsales", [Total sales],
            "@rank", [NIKE Sales Ranking]
        )
    RETURN
        MINX ( FILTER ( _tab, Company[Market/Nike] = "NIKE" ), [@rank] )

    Best Regards