Forum Discussion
Change Legend Order in Line and Stacked Chart Visual
hi vicente-iii
You could use Sort by column in power bi desktop to get it.
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
Just add a sort column for legend field in edit queries or in the data source
Then set sort by column for it.
Here is my sample pbix file, please try it.
BeforeAfter
Regards,
Lin
- vicente-iii6 years ago
Helper I
HI v-lili6-msft ,
Thanks for the reply. Let's say I have a line called E which is the target value for different months. It will have a legend called E. If I want to put that legend as the first legend the user will see, is this possible?
I am unable to achieve this using the sort by column function as the values used in the y-axis of the column chart (actual values) are different from the y-axis of the line chart (target values) - they are in different columns. And I want to bring the legend for the target values forward to be the first in the legend list.
- v-lili6-msft6 years ago
Community Support
hi vicente-iii
After my research, it could not be achieved in power bi for now.
The sort of lenged of Line and Stacked Chart Visual will be column in the front, then show line.
you may put it as an idea on ideas forum or vote if an idea already exists.
Regards,
Lin