Marimekko chart

A Marimekko chart (sometimes also called a Mekko chart) is similar a to stacked bar chart, but additionally uses varying widths of bars to communicate additional information about the data. Here, for example, is a Marimekko chart showing the breakdown of sales by region and department. The width of the bars communicates the total sales for the Region while the height of each segment gives you the percentage of sales for the Department within the Region:

Creating Marimekko charts in Tableau leverages a feature introduced in version 10. Specifically, we leverage the ability to fix the width of bars according to axis units.

Clicking on the Size shelf when a continuous (green) field is on Columns (thus defining a horizontal axis) and the mark type is set to Bar reveals options for a fixed size. You can manually enter Size and Alignment or drop a field on the Size shelf to vary the widths of the bars.

Here are some of the details:

  • The mark type has been specifically set to Bar.
  • Region and Department have been placed on Color and Detail respectively. They are the only dimensions in the view, so they define the view level of detail.
  • Sales has been placed on Rows and a Percentage of Total quick table calculation applied. The Compute Using (addressing) has been set to Department so that we get the percentage of sales for each department within the partition of the Region.
  • The calculated field Sales for Region calculates the X-axis location for the right-side position of each bar. The code is as follows:
      IF FIRST() = 0 
          THEN MIN({EXCLUDE [Department] : SUM(Sales)}) 
      ELSEIF LOOKUP(MIN([Region]), -1) <> MIN([Region]) 
          THEN PREVIOUS_VALUE(0) + MIN({EXCLUDE [Department] : SUM(Sales)}) 
      ELSE 
          PREVIOUS_VALUE(0) 
      END 

While this code may seem daunting at first, it is following a logical progression. Specifically, if this is the first bar segment, we'll want to know the sum of Sales for the entire region (which is why we exclude Department with an inline level of detail calculation). When the calculation moves to a new Region, we'll need to add the previous Region total to the new Region total. Otherwise, the calculation is for another segment in the same Region, so the Regional total is the same as the previous segment.

  • The field on Size is an ad hoc level of detail calculation with the code {EXCLUDE [Department] : SUM(Sales)}. As before, this excludes the department and allows us to get the sum of sales at a Region level. This means that each bar is sized according to total sales for the given Region.
  • Clicking on the Size shelf gives the option to set the Alignment of the bars to Right. Since the preceding calculation gave the right position of the bar, we need to make certain the bars are drawn from that starting point.
  • Various fields have been copied to the Label shelf so that each bar segment more clearly communicates the meaning to the viewer.
To add labels to each Region column, you might consider creating a second view and placing both on a dashboard. Alternately, you might use annotations.
For a more comprehensive discussion of Marimekko charts, along with approaches that work with sparse data, see Jonathan Drummey's blog post: https://www.tableau.com/about/blog/2016/8/how-build-marimekko-chart-tableau-58153.

In addition to allowing you to create Merimekko charts, the ability to control the size of bars in axis units opens up all kinds of possibilities for creating additional visualizations such as cascade charts or stepped area charts. The techniques would be similar to those used here. Additionally, you can leverage the sizing feature with continuous bins (use the drop down menu to change a bin field in the view to continuous from discrete). This allows you to have histograms without large spaces between bars.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset