Power BI Stacked Bar Chart Sorted by Value [With Examples]

This Power BI tutorial helps you work with a stacked bar chart sorted by value in Power BI.

Recently, I was working on a Power BI report where sorting a stacked bar chart by value helps me visualize which categories are the biggest contributors clearly and understandably.

In this tutorial, we will learn how to sort Power BI Stacked bar charts by value and how to sort Power BI stacked bar charts by legend.

Power BI Stacked Bar Chart Sorted by Value

This example shows how to sort Power BI Stacked bar charts by value.

Scenario:

You run a store selling different product categories, like fruits, vegetables, and snacks. Using a stacked bar chart sorted by value in Power BI, you can quickly see which products bring in the most money, helping you decide where to focus your efforts and make better business decisions.

According to this scenario, we have a SharePoint list named Store Sales Data that contains the following columns with various data types:

ColumnsData Types
Product NameSingle line of text
CategorySingle line of text
Sales($)Currency
power bi stacked bar chart order by value

Follow the below step to sort Power BI Stacked bar charts by value:

1. Open Power BI Desktop and load data using the Get data option. Then, we can see the data set in the Data Panel.

Power bi stacked bar chart sort axis

2. Under the Home tab, expand Visual gallery (black box) -> Click the Stacked bar charts.

power bi stacked bar chart values

3. Then, use the +Add data option to add Category into the Y-axis, Sales into the X-axis, and Product Name into the Legend field.

Power bi stacked bar chart sort by descending

4. After that, you will see our Power BI stacked bar chart successfully created.

Power bi stacked bar chart sorted by value

5. Select the stacked bar chart, then click on the three-dot () header icons at the top of the chart. A dialog box will open. In the dialog box, click on the Sort axis.

Power bi stacked bar chart sort ascending

In the above box, “Category” refers to the alphabet, and “Sum of Sales ($)” represents the values. We have the option to sort by value (ascending/descending) or alphabetically (ascending/descending).

Now we see sort by value ascending in the stacked bar chart.

6. Select Stack bar chart -> click on the three-dot () -> Select Sort axis -> Select Sum of Sales ($) and Sort ascending.

how to sort Power BI Stacked bar charts by value

This way, you can sort Power BI Stacked bar charts by value in ascending or descending order.

Power BI Sort Stacked Bar Chart by Legend

Now we see how to sort the Power BI stacked bar chart by legend in ascending or descending order.

Creating a stacked bar chart before we begin sorting in the Power BI stacked bar chart is important. Let’s consider the stacked bar chart we created above for this example.

1. Select the stacked bar chart, then click on the three-dot () header icons at the top of the chart. A dialog box will open. In the dialog box, click on the Sort legend.

Power BI sort stacked bar chart by legend

2. Next, select “Product Name” and sort it in descending order.

power bi stacked bar chart sort legend by value

Now, you should notice the changes. If not, you can hover over the stack in the Power BI Stacked bar chart.

how to sort the Power BI stacked bar chart by legend

Alternatively, you can sort it in ascending order to observe the differences.

Sort Stacked Bar Chart by Legend in Power BI

This way, you can sort the Power BI stacked bar chart by legend in ascending or descending order.

Conclusion

I hope you follow the above steps to sort the stacked bar chart in Power BI.

This tutorial taught us how to sort Power BI stacked bar charts by value and sort stacked bar charts by legend with some real scenarios.

Additionally, you may like some more Power BI tutorials: