How to Create a Sankey Diagram: Step-by-Step Guide and Example
Make a Sankey diagram in five steps: pick one quantity, list the nodes, enter the flows, check that every node balances, and label it. Includes an editable example.
To make a Sankey diagram you need a list of flows: where something starts, where it goes and how much. The rest is checking that the numbers add up and choosing what to label.
The example above follows 1,000 support tickets. Some are resolved at first contact, the rest are escalated, and some of those are resolved later while a few stay open. It is small enough to see every step and has the two shapes most Sankey diagrams have: a split and a loss.
You can build one by typing nodes and amounts into a table, or by pasting a source, target, value list into a blank Sankey. Either way the order of work is the same.
The five steps
- Choose one quantity and one unit. Tickets, euros, kilowatt-hours or visitors, but not a mix.
- List the nodes. Start with the sources, then each stage, then the destinations.
- Enter the flows. For each pair of connected nodes, write the amount that moves between them.
- Check that every node balances. For any node in the middle, what comes in should equal what goes out. If it does not, you have a typo, a missing flow or a loss you have not drawn.
- Label and style it. Name the columns, set the unit, and choose colours that mean something.
Draw the losses
The most common mistake is to leave out what does not continue. If 380 tickets are escalated and only 300 are resolved, the other 80 still exist. Give them a node, here Still open, so the diagram balances and the loss is visible.
The same goes for unconverted visitors, scrap in manufacturing, or energy lost as heat.
Doing it in a spreadsheet or a tool
A spreadsheet is a good place to keep the numbers, but Excel's standard chart types do not include a Sankey diagram at the time of writing, so most people draw it in a tool that does. A Sankey tool needs the same three columns a spreadsheet already has: source, target and value.
Key points
- 1,000 tickets enter; 920 are resolved and 80 are not, a resolution rate of 92% in this example.
- Of the 380 escalated, 300 are resolved, so escalation resolves about 79% of what reaches it.
- Every node balances: 620 + 380 = 1,000 in; 300 + 80 = 380 out of Escalated.
- The numbers are invented.
The example’s data
Invented ticket counts for one period, chosen so that every node balances.
| From | To | Amount (tickets) |
|---|---|---|
| Tickets | Resolved at first contact | 620 |
| Tickets | Escalated | 380 |
| Escalated | Resolved after escalation | 300 |
| Escalated | Still open | 80 |
The same data as CSV
source,target,value
Tickets,Resolved at first contact,620
Tickets,Escalated,380
Escalated,Resolved after escalation,300
Escalated,Still open,80How it works
Enter the sources and their amounts
Add the first node and the nodes it flows to, with the amount on each flow.
Continue to the next stage
Add the flows out of each of those nodes until every quantity has reached an end.
Check the balance
Any node that sends out more than it receives is flagged. Fix it, or draw the missing source.
Frequently asked questions
How many nodes should a Sankey diagram have?
As few as will answer the question. Past a dozen or so nodes per column the bands get thin and the labels collide, so group the small ones into Other.
Do I need special software?
You need something that draws Sankey diagrams. You do not need to write code: a table of nodes and amounts, or a source, target, value list, is enough in QueryChart.
Start a Sankey diagram
Opens a new Sankey chart with a place to paste a source, target and value list.