Forum Discussion

harshagraj's avatar
harshagraj
Post Partisan
3 years ago
Solved

Sort Axis and legend

Hello all, how can i sort below data by highest week. Here Plant 07 should come first because its highest week(52) has highest amount.

PlantAmountWeek
09282650
09276349
04268352
04262051
09250551
09246149
09233348
 202551
09180652
04165349
08159249
04152350
11151248
11142649
09139651
 128652
09121748
11121352
09118850
08117648
07117548
01113352
07108948
04106848
07104150
07103851
07102650
07909649
07907549
07761252
11727151
04718049
08685551
04653850
07632551
01624451
04590148
09590052
 582949
07572252
11498250
 467648
08435250
 390250
08364052
04363351
01352150
01340348
04207052
01198949

 



amitchandak 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi harshagraj ,

     

    Here I suggest you to try to create a rank column by dax.

    Rank = 
    RANKX (
        'Table',
        CALCULATE (
            SUM ( 'Table'[Amount] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Plant] ),
                'Table'[Week] = MAX ( 'Table'[Week] )
            )
        ),
        ,
        DESC,
        DENSE
    )

    Then add this calculated column into visual tooltips and use max function in tooltips. Finally, sort your visual by [Max of Rank] in tooltips. Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

     

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi harshagraj ,

     

    Here I suggest you to try to create a rank column by dax.

    Rank = 
    RANKX (
        'Table',
        CALCULATE (
            SUM ( 'Table'[Amount] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Plant] ),
                'Table'[Week] = MAX ( 'Table'[Week] )
            )
        ),
        ,
        DESC,
        DENSE
    )

    Then add this calculated column into visual tooltips and use max function in tooltips. Finally, sort your visual by [Max of Rank] in tooltips. Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

     

  • harshagraj try this:

     

     

    Follow us on LinkedIn and  to our YouTube channel

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.