Forum Discussion

amhiggins's avatar
amhiggins
Frequent Visitor
4 years ago
Solved

Sort Legend by Chart Value

Hello,   I have a line chart showing the running count of sometime over time per category. There happen to be a lot of categories in my data set which is out of my control. Here is an example plot ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  amhiggins ,

    I created some data:

    Here are the steps you can follow:

    1. Enter the Power query, click Table, and click Copy to form Table2.

    2. In Table 2, Home – Group By.

    New column name – Max.

    Operation – Max.

    Column – amount.

    3. Select the newly appeared [Max] and select Sort Descending.

    4. Add Column – Index Column –From 1.

    5. Place [Qtr] of Table in Axis, [amount] of Table in Values, and [group] of Table2 in Legend.

    6. Click [group] of Table2, Column tools – Sort by column – Index.

    7. Result.

    Here it will be sorted with Index.

     

    Best Regards,

    Liu Yang

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