Thursday, December 28, 2023

Lesson 28 - Stacked bar chart in Power BI Desktop

A stacked bar chart is a visual representation that uses horizontal bars to display data. Each bar represents a category or group, and it is divided into segments to depict subcategories or individual components of the data. It helps illustrate the composition of a whole while showing the contribution of individual parts.


How to Proceed?

Step 1
Launch power BI desktop app and open the new report page and import the data required. 




Step 2
In “visualizations” pane click on “Stacked bar chart” which is highlighted in the given figure.






Step 3
Drag the data fields into “Field Section “that you want to analyze 
using the stacked bar chart.




Y-axis: Represent categories or groups that you want to compare - Continent

X-axis: Represents numerical value that you want to display within each category or group in X-axis – Medal Count

Legend: Represents sub-categories within each group displayed on Y-axis. Subcategories are visually stacked within each bar - Gender



Step 4

Filters in 100% stacked bar chart enable users to selectively focus on specific categories or subcategories of data for deeper analysis.

Here I applied basic filter eliminating NA in continent and for Medals eliminated No medal category

Step 5

Customizing the appearance

You can customize the appearance of the visual.  You can change Title, Font size, Style, Colours and Data labels. 
Click anywhere on the visual and set the below properties in the Format section.



You are allowed to choose colours for sub-categories to differentiate them. This improves clarity and helps viewers easily identify and understand the distinctions between various sub-categories within your chart.

“Reverse stacked order” option allows you to rearrange the order of data series easily. 



Spacing refers to the gap or distance between individual columns or bars within the chart. Adjusting the spacing can impact the overall appearance and readability of the chart.

Data labels are used to display specific numerical values associated with each individual stack within each bars. You can adjust the font, colour and position of the data labels within the chart. 

Total labels represent the sum or total value of all the individual segments in a given bars. This label shows combined value of all the sub-categories within each category.

In this figure, I have highlighted total labels using red-colored circles.



Step 6 Save the visual

Finally, your Stacked bar chart is ready. Click save button to save the visual.










When to use Stacked bar chart?

Stacked bar chart and a stacked column chart in Power BI is chosen by number of categories, the length of category names, and the visual preferences of the clients. Both charts serve the purpose of illustrating the composition of total values, but the orientation differs based on whether we are using bars or columns.
  • When we want to track changes on data composition over a period of time, you can use stacked bar chart.
  • To  enhance the ability to spot patterns, anomalies, or trends in data composition more effectively, utilize the  color-coded segments in a stacked bar chart.
Pros
  • Stacked bar charts are easy to make and understand, so wide audience can use them. 
  • Effectively displays trends over a period, especially when a time series is placed on the X-axis.
  • The automatic aggregation of values within each category simplifies the presentation of cumulative data.

Cons
  • We may get confused if the bar stacks have 4 or 5 layers.
  • It is difficult to read the values when we have too many bars

Conclusion

Stacked bar charts are a useful visualization tool for displaying proportions ,tracking trends over time and highlighting relative compositions within datasets. Whether you are analyzing budget breakdowns, sales distribution, or market segment compositions, a stacked bar chart often serves as the most effective visualization tool.

Tags Power BI
Useful links
MS Learn Modules
Test Your Knowledge Quiz

No comments:

Post a Comment