This is a Quick Tip on how to build a Pyramid Step Chart in Tableau, so less reading and more jumping in. We are going to spend 5 minutes or less building our Pyramid Step Chart in Tableau.

Note: As always never choose a data visualisation type and try to fit your data into it, instead, understand your data and choose the best visualization for your data consumers.

Data

Load the following data into Tableau Desktop / Public.

Country,Path,Value
United States,1,0.8
United States,101,0.8
United Kingdom,1,0.67
United Kingdom,101,0.67
France,1,0.4
France,101,0.4
Germany,1,0.5
Germany,101,0.5
Japan,1,0.9
Japan,101,0.9

Note: we require path and duplicate lines for densification. See our tutorial on Data Densification for more information. Click here

Calculations

We will start by creating the following calculated fields.

Path (bin)

  • Right-click on Path
    • Go to Create, and select Bins…
    • In the Edit Bins window:
      • Set New field name to Path (bin).
      • Set Size of bins to 10.
      • Click OK.

Index

INDEX()

TC_Value

WINDOW_MAX(MAX([Value]))

Color

IF [Index] > WINDOW_MAX([Index])*(1-[TC_Value]) THEN
    IF [TC_Value] > 0.8 THEN
        "Green"
    ELSEIF [TC_Value] < 0.5 THEN
        "Red"
    ELSE
        "Orange"
    END
ELSE
    "Grey"
END

Calculated Fields

Now that we have created our Calculated Fields, we will build our Worksheet.

  • Change the Mark Type to Bar.
  • Drag Country onto Columns.
  • Drag Path (bin) onto Rows.
    • Right-click on the object and ensure that Show Missing Values is check.
  • Drag Index onto Columns.
    • Right-click on the object, to go Compute Using and select Path (bin).
  • Drag Color onto the Color Mark.
    • Right-click on the object, to go Compute Using and select Path (bin).
    • Right-click on the object and select Edit Table Calculation.
    • With Nested Calculation set to Color, select Specific Dimensions.
      • Select both Country and Path (bin) and ensure that Country is on top.
      • Set Restarting every to Country.

If all goes well, you should have the following:

Now we will adjust the cosmetics:

  • Hide the headers.
  • Set Row Divider to None.
  • Set Column Divider to None.
  • Set Zero Line to None.
  • Set Grid Lines to None.
  • Edit the Colors.

We are almost there, we have a half pyramid and should have something like the following:

Now we have the following final touches.

  • Drag Value to Columns between Country and Index.
    • Right-click on this object and set this to Discrete and Dimension.
    • Format this to a percentage.
  • Keep your finger on Ctrl, and left-click on Index and Drag to right and let it go, this will copy the Index Pill. This is a real time-saver.
  • Now the final touch will be to double-click on the left Index Pill, add a minus sign to the left; this is an example of inline manipulation.

You should now see the following:

and boom, we are done, nice, simple and quick. You find my Pyramid Step Chart Dashboard on Tableau Public at
https://public.tableau.com/profile/toan.hoang#!/vizhome/PyramidStepCharts/PyramidStepChart

Summary

I hope you all enjoyed this article as much as I enjoyed writing it. Do let me know if you experienced any issues recreating this Visualisation, and as always, please leave a comment below or reach out to me on Twitter @Tableau_Magic.

If you want to learn more about Creating Bespoke Data Visualisations in Tableau, do check out our course on Udemy at https://www.udemy.com/course/creating-bespoke-data-visualisations-in-tableau

14 COMMENTS

  1. Toan Hoang, thanks for the tutorial I am awestruck by your drawings and out of box charts in Tableau and lucky to be part of Tableau Magic. Hope you will be adding tutorials for the below charts.

    1) Stacked 3D Circle Charts in Tableau
    2) Filled Arc Timeline Charts in Tableau
    3) Dot Quadrant Charts in Tableau

  2. Hi Toan,
    Again with fantastic chart.
    I have been facing an issue regarding Table Calculation :
    After place color field onto color. I have set “Compute Using” Country and Path (bin) (First country then path (bin)
    “At the level” : Deepest
    Restarting every : Country

    But my chart not shrink as your in the above picture. I have using Tableau 9.2.
    Thanks

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.