Power Bi Stacked Column Chart Multiple Legends

Do you want to display multiple legends in the Power BI stacked column chart? This Power BI tutorial will explore how to achieve this by implementing a dynamic legend.

Unfortunately, the Power BI Stacked column chart does not support adding multiple legends.

However, I got an idea; we will create a dynamic legend. Instead of using the Legend field, we will utilize the slicer, which contains columns such as Product, Segment, Year, etc.

So, when a user selects a specific category like “Year,” for instance, in the Power BI stacked column chart currently displaying Sales based on Product, it will show Sales based on Product and Year accordingly.

stacked column chart multiple legends in Power bi

Power BI stacked column chart multiple legends

Here, we will see how to display dynamic multiple legends in the stacked column chart.

The steps we are going to follow to create a dynamic legend.

  • Load the data to Power BI
  • Create a New parameter
  • Use the Parameter in the Slicer and Stacked column chart
  • The final result of Dynamic Legends

To do this workaround, we will use the Financial Excel workbook, to create a Stacked column chart.

power bi stacked column chart multiple legend

Load the data to Power BI

  • Open Power BI Desktop and then click on the Excel workbook from the ribbon.
Stacked Column Chart with two values and one legend
  • From your local system, select the Workbook
  • Then the Navigator window will open, here select the table and then click on the Load button.
Stacked Chart with Multiple Legend Items
  • Now, data gets loaded into the Power BI Desktop.
Legend not working in stacked column chart

Create a New parameter

  • To create a new parameter, click on the Modelling tab, then select the New parameter option -> select the Fields.
multiple legends stacked column chart in Power BI
  • The parameter window will open, here provide the name of the parameter under Name.
  • Under Fields, you can see the table, and select the fields you want to add to the legends.
  • Click on the Create button.
Multiple legends in Power Bi stacked column chart


It creates a table in the Power BI Field pane and automatically adds a slicer to the page containing multiple legend columns.

power bi stacked column chart multiple legends

Use the Parameter in the Slicer and Stacked column chart

  • Since our slicer is already created, let’s proceed to create a Power BI Stacked column chart.
  • To do this, navigate to the visualization pane and select the Stacked column chart visual.
  • Now, the blank chart will be added to the page in Power BI.
multiple legends power bi stacked column chart
  • Drag and drop the Sales, Product, and Multiple legends in Y-axis, X-axis, and Legend, respectively.
Microsoft power bi stacked column chart multiple legends

The final result of Dynamic Legends

  • From the slicer, you can select a column, and based on that, the Stacked Column chart in Power BI reflects the data. For example, if I select “Year” from the slicer, you can see that the Power BI stacked column chart displays sales by product and year.
 multiple legends Microsoft power bi stacked column chart

Conclusion

This Power BI tutorial taught us how to work with multiple legends in the Power BI stacked column chart.

See also  Power Apps Pie Chart- Let's Build It

You may also like the following tutorials:

>