Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

RankX

RankX measure in card visual is showing a different number to the rank displayed in a table visual, 

 

Is there any solution for this?

 

6 Replies

  • Anonymous 

    Yes that's correct, it all depends on the context on which the calculation happens. Please provide some data and the expected results.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I am using the RANKX(ALL(Category[Category Names]), [Premium]) formula in the table and card visual. When I filter for a specific category it gives a different result in the table and card visual.

       

      Do I need to use a different measure for the card visual?

      • Fowmy's avatar
        Fowmy
        Super User

        Anonymous 

        You can use the same measure for both as follows. Change DESC  to ASC if needed.

        Rank Category = 
        
        RANK(
            DENSE,
            ALL(Category[Category Names], 
            ORDERBY( [Premium], DESC ) 
        )
        

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    I tried the following but am getting blank appear in the visual. 

    Test Rank = RANK( DENSE, ALL(Category[Category Names]), ORDERBY( [Premium], DESC ))

     

    Note the premium amount is a DAX measure that has been used.

    In the card visual I am adding a filter to select only one category. 

     

     

    Example Data as below

     

    Rank Category    Premium

    1       Food          £100

    2       Lifestyle     £80

    3       Transport   £60

    4       Education   £20

     

     

    When I put transport in a card it gives the rank as 4 when it should be 3 as shown in the table. 

     

     

      • Anonymous's avatar
        Anonymous
        Not applicable
        Thank you so much! This has now worked 🙂