Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello good people!
I have run into an issue with my graph in Power BI. I currently have a Stacked Column Chart, where there is Date on X-Axis and Measures that return values on Y-Axis. The legend is sorted like this:
That means the measure that is on the bottom of the graph is shown as first in legend etc. I would like to invert the legend, so it's in the same order both in the graph and in the legend. How do I do it?
Thank you and have a great day!
Solved! Go to Solution.
Hi @Veternus
Your graph and text are currently sorted in the same way. However, since graphs start from the bottom and go up, the beginning and base are at the bottom (laws of construction and physics 🙂 ). On the other hand, a legend is a list, and lists of text go up to the top. Therefore, it looks reversed. So you actually want to sort the graph and the legend in reverse order. Since there is no way to do this from the graph, you can create a table with conditional formatting that matches the legend and group it with the graph.
The steps you can apply to achieve the result :
1. Create a disconnected table with the column of measure name and the column of sort order :
2. Sort the names of measures by the order column :
3. Create a measure for a circle ( like graph's marker)
5. Change the column name of the circle to space + apply conditional formating :
6. Switch off the legend of the graph and group the table with the graph:
Pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
My Visualizations pane looks like this:
Each of the "Test1, Test2..." values is a different measure.
I want to achieve this:
Hi @Veternus
Your graph and text are currently sorted in the same way. However, since graphs start from the bottom and go up, the beginning and base are at the bottom (laws of construction and physics 🙂 ). On the other hand, a legend is a list, and lists of text go up to the top. Therefore, it looks reversed. So you actually want to sort the graph and the legend in reverse order. Since there is no way to do this from the graph, you can create a table with conditional formatting that matches the legend and group it with the graph.
The steps you can apply to achieve the result :
1. Create a disconnected table with the column of measure name and the column of sort order :
2. Sort the names of measures by the order column :
3. Create a measure for a circle ( like graph's marker)
5. Change the column name of the circle to space + apply conditional formating :
6. Switch off the legend of the graph and group the table with the graph:
Pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Oh yeah, I understand why it's sorted this way, but our management doesn't like it -.-
Thank you for this solution, it answers my question and does the precise thing I need it to do 👍
Happy to help 🙂
To invert the legend order in your Stacked Column Chart in Power BI, you can follow these steps:
1. Select the visual (the Stacked Column Chart) where you want to invert the legend order.
2. In the Visualizations pane on the right, find the field that you're using for the legend (in your case, it seems to be the "Measure" field).
3. Click on the ellipsis (...) next to the "Measure" field in the Visualizations pane to open the context menu.
4. From the context menu, select "Sort By" and then choose the measure you want to sort by. This will change the sorting order of the legend.
5. If the measure you want to sort by is not listed in the "Sort By" options, you may need to create a new measure specifically for sorting purposes. You can create a measure that assigns a numeric value to each category based on the desired sorting order.
6. After sorting the legend by the desired measure, the legend order should be inverted to match the order in the graph.
By following these steps, you should be able to invert the legend order in your Stacked Column Chart to match the order in the graph.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.