How to create a Marimekko Chart

Marimekko Chart

A Marimekko or Mekko chart is a type of chart that works such as a stacked bar plus a tree map, or for a better understanding, a stacked bar horizontally and vertically. The usability is that it will give us the possibility to display another variable to look at, so let’s learn how to create a Marimekko Chart.

Step 1: Connect to data

→ In Tableau Desktop, connect to Global Superstore data provided by Tableau.

Step 2: Create the necessary calculations

Create a calculated field called “Region Sales”

  {FIXED [Region]: sum([Sales])}

→  Create a calculated field called “Running Total Region”

IF FIRST()=0 THEN MIN([Region Sales])

ELSEIF MIN([Region])<> LOOKUP(MIN([Region]),-1) THEN PREVIOUS_VALUE(0)+MIN([Region Sales])

                            ELSE PREVIOUS_VALUE(0)

END

 Step 3: Build the visualization

Create a table from Region and Category as dimensions and the Sales for measures:

Drag “Region” to Rows

Drag “Category” to Rows

Bring Sales to the Text Mark

We should find out the % of each Category by Region so we’ll apply a table calculation:

Right-click Sum(Sales) and apply a Table Calculation for a % of Total with the Specific Dimensions ticked for Category. This will drive our vertical stack.

Bring Measure Values in order to add the Sales again so that we can reference it and the Region Sales and Running Total Region calculations we did:

The Region Sales calculation will help us determine the width of each bar and the horizontal stack. We will do that by fixing the sales cumulated in every region with a lod.

The Running Total Regions calculation basically does a running total by making sure to keep the values the same for each region: if it’s the first row then we will get the Region Sales value, otherwise, add the new region sales to the previous one.

Let’s duplicate the worksheet and start building our chart :

Right-click on the worksheet and “Duplicate”

Rename the newly created worksheet as Mekko Chart

Follow the next steps in order to build the viz:

Bring “Measure Values” pill from Text to Detail

Remove the “Measure names” pill

Starting from the right side, in this order, add “Category” then “Region” to Detail

Add the “SUM(Sales)” table calculation to rows

Add “Running Total Region” to columns

Change the marks to bar

Add region Sales on Size and fix the size starting on the right side, this will consider the right edge of the column as a starting point

Bring Category also to Color Mark

Bring Region also to text Mark

Format the Marks as desired…great work, you’ve successfully built a Mekko chart! 🙂

Watch the video tutorial here:


About btProvider:

We hold all possible technical and sales certifications for all products:

Tableau Desktop, Tableau Public, Tableau Server, Tableau Prep, and Tableau Data Management.

With Tableau Software – the best data visualization platform – you can always understand your business or your job better. Using Tableau, you will take intelligent and strategic decisions and quickly understand the data flow, numbers and the results it produces. See other #skillpill video tutorials here:

How to display multiple insights on a dashboard in #Tableau

How to create Stacked Bars on Grand Totals in Tableau

How to create a Buffer Zoom in a Tableau Map

Are you interested in learning more about Tableau Software – one of the best analytics tools and implementing the solution in the entire company? 

Contact us!

See how Tableau works, by downloading a free trial here: