Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a line chart with monthly granularity over a year. I need the legend at the top of the chart to sort by the count of items in each category and for the tooltip to sort by count of items in each category at the monthly level. I tried creating a rank column that has the desired granularity for monthly but it breaks the line chart, and if I try the yearly level the tooltip is out of order. If I try to sort the category column itself by the monthly column I get the error about not having multiple values in Y for sorting X. Is there any way to sort the legend by the values and not the categories?
Current tooltip/legend:
A | 2 |
B | 5 |
C | 1 |
D | 3 |
Desired tooltip/Legend
B | 5 |
D | 3 |
A | 2 |
C | 1 |
Solved! Go to Solution.
PowerBI has enabled this functionality in the Visualisations pane now.
Here is how to do it.
1) Go to Columns:
2) Under Layout, turn 'Sort by value' to ON
3) You may choose to reverse order to keep largest quantity at bottom and smallest at top.
PowerBI has enabled this functionality in the Visualisations pane now.
Here is how to do it.
1) Go to Columns:
2) Under Layout, turn 'Sort by value' to ON
3) You may choose to reverse order to keep largest quantity at bottom and smallest at top.
thank you. I have searched a lot for this issue and this is the only solution that made sense
Looks like this works for sorting within the column, but does not reflect in the legend order. Anyone know how to sort the legend by value as well?
Hi, @wcarter
You can use sort column by another column feature; furthermore, you can also create a custom sort order by creating a new sort column. Then use the visual option "Sort Legend".
You can refer to the following blogs and videos to help you.
Sort Legend Power BI Feature Tutorial And Review
Sort Legend Tutorial And Review - Power BI November 2021 Updates
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This worked for me.
So the problem I have with this is that my Values on my line chart is a Count of the values in another column, and that second column has many duplicate values which gives me the error that 'There can't be more than one value in Column A for the same value in Column B" if I try to use it as the Sort By for Column A.
See below the issue I have with the Legend/Tooltip behavior, it only sorts by alphabetical of the legend items, I need to sort by value of the legend items:
Thank you!
please provide sample data as requested. Include a filter column so that we can create a measure based solution.
Here's a PBIX with sample data that fits the pattern I am working with. I need to sort Animal by Count of Sequence in the Tooltip so that when you hover over the line chart the items are in order of the values and not alphabetical, as indicated in my graphic. Thank you.
@wcarter Thank you for providing the sample data. That helps a lot with proposing a potential solution.
See attached for a possible implementation with tooltip pages.
You can only sort a column by another column. If you want to sort a visual by a measure then you need to put that measure in the visual, or in the tooltips area.
Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.