cancel
Showing results for
Did you mean:
Post Partisan

## 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.

 Plant Amount Week 09 2826 50 09 2763 49 04 2683 52 04 2620 51 09 2505 51 09 2461 49 09 2333 48 2025 51 09 1806 52 04 1653 49 08 1592 49 04 1523 50 11 1512 48 11 1426 49 09 1396 51 1286 52 09 1217 48 11 1213 52 09 1188 50 08 1176 48 07 1175 48 01 1133 52 07 1089 48 04 1068 48 07 1041 50 07 1038 51 07 1026 50 07 9096 49 07 9075 49 07 7612 52 11 7271 51 04 7180 49 08 6855 51 04 6538 50 07 6325 51 01 6244 51 04 5901 48 09 5900 52 5829 49 07 5722 52 11 4982 50 4676 48 08 4352 50 3902 50 08 3640 52 04 3633 51 01 3521 50 01 3403 48 04 2070 52 01 1989 49

1 ACCEPTED SOLUTION
Community Support

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 3
Community Support

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.

Resolver I

Hello

you can try this -

Super User

@harshagraj try this:

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.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Announcements