How to create Sankey chart in Tableau?

What is Sankey Chart?

The Future of Work in India: Trends, Challenges, and Opportunities

How to create Sankey chart in Tableau?

(INDEX()-25)/4
# Rank 1  - Use the below equation to create first column
RUNNING_SUM(SUM([Sales]))/TOTAL(SUM([Sales]))

# Rank 2  - Use the below equation to create second column
RUNNING_SUM(SUM([Sales]))/TOTAL(SUM([Sales]))
# Create the sigmoid calculated field using the equation below - 
# Column Name = "Sigmoid"
1/(1+EXP(1)^ -[T]) 
  1. Drag “T” to column shelf and padding to detail in the Mark shelf. From the drop down change your mark to circle.
  2. Set up the “T” field to compute based on the padding. After performing a right-click on “T,” select “Edit Calculation,” then select “Specific Dimension” and enable padding. Following the modification of the computation’s configuration, 49 marks should appear rather than 1.
Create Sankey chart in Tableau Step 3
  1. Since you already added “T” to column shelf and “Padding” to detail, now add “Curve” to the Row shelf.
  2. In the next step Configuring the “Curve” table calculation here, we are using the columns Segment and Region. Thus, those two dimensions will be dragged into the details shelf. and set them up appropriately. This is a crucial section since it will determine how your Sankey chart will appear.
  3. When you right-click on the Curve field and select “Edit Table Calculation,” a line labelled “Nested Calculation” will appear. This is where we set the parameters for the sankey’s movement.

In the nested calculation select Rank 1 first, then select ‘Specific Dimension’ and arrange in the below order.

Now, select “Rank 2” in the nested calculation and arrange in the below order.

Step 5.1 – Open new sheet and drag Region to color and sales into Rows. Right click on sales and change the Sales calculation to a table calculation as “% of Total”. Edit the axis and make it from 0 to 100%. Add proper labels and sort the chart based on Sales and arrange by descending.

Step 6: Configure the line and size of Sankey

Step 6.1 – We have all the 3 necessary sheets for the Sankey chart now have to edit the Sankey to look better. Range of the Sankey needs to be between -5 to 5 on X axis (T). As for the Y axis (Curve), we must sort the dimensions in the same way as the two sheets before it. We constructed. The range from 0 to 1 must be fixed, and the axis must be reversed.

Step 6.2 – Create the calculated field to resize the Sankey using the below equation –

# Calculated field to resize the Sankey
# Filed name - Sales Sizing
WINDOW_AVG(SUM([Sales]))

Step 6.3 – Drag ‘Sales sizing’ into size shelf. Right click –> Edit table calculation –> Specific dimension –> Select Padding

Step 6.4 – Now increase the size of the lines and your Sankey chart is 80% ready.

Step 7 – Final step to create the Sankey chart in Tableau

  • Go to dashboard and add all 3 sheets together.
  • First chart should the region bar chart then the Sankey and final chart should be the segment bar chart.
  • Now your Sankey chart is ready.
  • Note –
    Hide the sheet title from all the charts and make sure stacked bar chart size is full
Scroll to Top