Forum Discussion

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

RANKX : different result on different graph

HI, I don't understand what is happening with my RANKX function. I rank different zone by result (different calcul). I do a table (down) and a Card (Up). On the exemple, we can see all the resu...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi chestercas ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create a measure. 

    Rank prod = 
    var _a=RANKX(ALL('DATA_BRMC'),'DATA_BRMC'[Prod/h log],MAX('DATA_BRMC'[Prod/h log]),DESC,Dense)
    var _b=IF(ISFILTERED('DATA_BRMC'[Zone]),_a,BLANK())
    return _b

    (3) Then the result is as follows.

    Note that this measure needs to be used with slicers when placed on a card visual, and if you only want to show the rank of [AG SUD EST], create a measure like the following and place it on the card visual.

    AG SUD EST rank = CALCULATE('DATA_BRMC'[Rank prod],FILTER(ALL('DATA_BRMC'),'DATA_BRMC'[Zone]="AG SUD EST"))

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.