Forum Discussion

PK_PBIBoss's avatar
PK_PBIBoss
Frequent Visitor
6 years ago
Solved

Measures not working for Chart Visual

I need to display top 10 Products for the Year on the cards and it changes randomly so I have created a Rank Measure but i am unable to use under visual filter and add the Category/Product Name as we...
  • v-juanli-msft's avatar
    v-juanli-msft
    6 years ago

    Hi PK_PBIBoss 

    Add measures in card visuals

    rank = RANKX(ALLSELECTED('Table 2'),CALCULATE(SUM('Table 2'[sale])),,DESC,Dense)
    
    top1 = CALCULATE(MAX('Table 2'[product]),FILTER('Table 2',[rank]=1))
    
    top2 = CALCULATE(MAX('Table 2'[product]),FILTER('Table 2',[rank]=2))

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.