We need to talk about Stacked Bar Charts

Power BI has several visuals that are often used to show size comparisons.  The visuals below show the relative sizes of Alaska, California and Texas using a pie chart, donut chart, tree view and a stacked bar chart.  Graphic designers may argue about which is best, but they all do the job.

When data from all fifty states are displayed the results are

Again, designers may have strong opinions on which is best, but they all behave as expected.

When the provinces of Canada are added to the data set, the first three visuals give us the following

Instead of allocating a colour to each State/Province, each Country is allocated the colour and every State/Province in that Country has that colour.

With a stacked bar chart, the behaviour is different. With one Country selected, the bar chart is very similar to what it was when there was only one Country in the data set.

This visual also displays the total area for each country – 3,855 thousand sq miles for Canada and 3,794 thousand sq miles for the USA. But when we select both countries, the totals have changed and Alberta, Alabama and Alaska have disappeared from the visual.

The reason for this is explained by this small blue i on the visual

When the i is clicked, the following message appears.

So how many is too many? To determine this I generated 400 data points, and classified them into 10 categories of 40 data points each.  One category gives 40 data points, which are all correctly displayed

However two categories only displays 30 data points each.

Five categories displays 12 data points each

With seven categories, four display 9 data points and three display 8 data points. Again, the blue I explains why.

So it seems that a stacked bar chart graph can only display sixty different categories, each with a unique colour. This limitation is specific to stacked bar charts – other visuals, like a Pie Chart or a Tree Map (shown below), can display all 400 data points in the data sample.


Discover more from MaxPowerBI.PRO

Subscribe to get the latest posts sent to your email.