Blog Post

Making Legend Order Match Segment Order in a Power BI Stacked Column Chart

,

A reader of one of my previous posts pointed out that the legend order and segment order in my core visual stacked column chart did not match. I had to ask the Power BI team about this, and they explain that there is a way to make them match, but it’s a bit unintuitive.

The Problem

My default, the legend order and segment order are opposite of each other, as shown in the chart below.

Power BI stacked column chart with gray segments on top and blue segments on bottom. The legend has blue segments on top and gray segments on bottom.

Notice how the gray segments are at the top of each column, but at the bottom of the legend.

The Solution

You can fix this by selecting your chart, going to the format pane, finding the Columns section, and enabling the Reverse Order toggle.

The Reverse Order toggle in the formatting pane under Columns -> Layout.

This will reverse the order of the segments in the actual chart. You can then sort the chart from the visual’s more options (…) menu.

Changing the sort legend setting to Sort descending

Now your column segment order and legend order will match.

Power BI stacked column chart with legend where both segments and legend have blue on top and gray on bottom.

I had probably noticed the reverse columns setting but had not considered its effect vs the legend.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating