Se ahorraron cientos de horas de procesos manuales al predecir la audiencia de juegos al usar el motor de flujo de datos automatizado de Domo.
Sankey Diagrams: Examples, Best Practices and How to Create (Including Excel)
Imagine trying to explain how a massive budget is spent or how energy is lost in a complex machine using only a spreadsheet. The rows and columns might be accurate, but they fail to tell the story of movement. You see the starting number and the ending number, but the journey in between gets lost in the cells.
But with Sankey diagrams, you get powerful visuals for showing flow, transfer, and distribution, especially where magnitude across paths matters. Unlike standard charts that show static comparisons, a Sankey diagram is all about movement. It visualizes how one set of values transforms into another, highlighting the relative weight of each path.
In this guide, we’ll cover what you need to know about Sankey diagrams. We’ll explore what they are, why and when to use them, and how they work. You’ll advice on how to design them, a look at some practical examples, and a step-by-step walkthrough on how to build them, with a special spotlight on how to handle them in Excel. Finally, we’ll review their limitations and answer some frequently asked questions to help you become a data storytelling pro.
What is a Sankey diagram?
A Sankey diagram is a specific type of flow diagram where the width of the arrows or lines is proportional to the quantity of flow. If a large amount of energy, money, or traffic moves from point A to point B, the line connecting them is thick. If the flow is small, the line is thin.
The central concept is simple yet effective. It shows how values change between stages, categories, nodes, or processes. This visual representation gives viewers a way to grasp complex transfers quickly without needing to read every single data label. It turns abstract numbers into a comprehensible “river” of information.
While they share similarities with other charts, Sankey diagrams differ significantly from simple flowcharts or network diagrams. A standard flowchart maps out a process sequence, such as “if yes, go here; if no, go there,” but all arrows are usually the same width. And a network diagram might show connections, but it doesn’t typically emphasize the volume of the connection. Sankey diagrams bridge this gap by visualizing both the structural connection and the quantitative volume simultaneously.
When (and why) to use a Sankey diagram
Knowing when to deploy a Sankey diagram is just as important as knowing how to build one. They aren’t suitable for every data set, but they’re unbeatable for specific scenarios.
Typical scenarios and use cases
Sankey diagrams are perfect in cases where you want to visualize the flow from a source to a destination. Common examples include:
- Energy flows: One of the original uses of the chart was showing how primary energy sources like oil, wind, or solar are converted into electricity and eventually consumed or lost as heat.
- Financial flows: Visualizing how a total budget is broken down into departments and then further into specific spending layers is a classic use case. It’s excellent for showing income vs spending.
- Customer or user journey transitions: You can track how people move through a website, showing where they land, where they click next, and where they drop off.
- Web traffic or funnel flow with magnitudes: Marketers use them to visualize the sales funnel, highlighting how many leads turn into prospects and how many prospects turn into customers.
- Migration or connection intensity among groups: Sociologists and geographers use them to show the movement of people between countries or regions.
Advantages
The primary advantage of a Sankey diagram is that it visualizes both structure and volume. You get the “what connects to what” information of a network graph combined with the “how much” information of a bar chart. This allows you to:
- Visualizes both structure and volume: You see the path and the quantity in one view.
- Shows relative weight of flows clearly: The eye is naturally drawn to the widest bands, making the most significant trends instantly stand out.
- Indicates bottlenecks, major contributors or drop-offs: If a wide band suddenly narrows or splits into many tiny threads, you can immediately identify inefficiency or dispersion.
When not to use
Despite their utility, there are times when a Sankey diagram is the wrong choice. You should avoid them when:
- The data has no meaningful flows: If you’re just comparing static categories like sales by region without any movement or transformation, use a bar chart instead.
- There are too many tiny paths: If your data results in dozens of hair-thin lines that look like spaghetti, the diagram becomes unreadable.
- Comparisons require high precision: While good for general proportions, it’s hard for the human eye to compare the exact width of two curved lines. If comparing exact values is critical, a table or bar chart is a better choice.
How Sankey diagrams work and mechanics
Understanding the mechanics of a Sankey diagram helps in both reading and creating them. The structure relies on two main components: nodes and links.
Structure
- Nodes: These are the rectangular blocks or bars that represent the stages, categories or entities. For example, in an energy chart, “Solar” and “Wind” would be nodes.
- Links (or flows): These are the bands that connect the nodes. The width of these links is strictly determined by the value of the flow they represent.
Directionality
Most Sankey diagrams flow from left to right, which mimics how we read text in many Western languages and implies a progression over time or through a process. However, more complex networks can sometimes flow top-to-bottom or even be circular, though these are less common and harder to read.
Flow calculations
The logic behind the chart is that the width of a link is scaled to a value. If the total flow entering a node is 100 units, the sum of the widths of all incoming links must represent 100 units. Similarly, if that node distributes those 100 units to three other places, the outgoing links must also sum up to 100, assuming no loss. This conservation of width is what makes the chart accurate.
Handling multiple input and output paths
Sankey diagrams are excellent at handling branching and converging flows. A single input node can split into five outputs, or five inputs can merge into a single output. To make this work, your data organization must be precise. You typically need a “source–target–value” table structure, where every row defines where a flow starts (source), where it ends (target) and how big it is (value).
Types and variants
While the standard left-to-right flow is the most recognizable, there are several variants depending on the complexity of your data.
Simple two-stage Sankey
This is the most basic version, showing a direct flow from input to output. For example, a chart showing “College Majors” on the left and “Career Paths” on the right. It connects two dimensions directly. This is often used for simple “before and after” comparisons.
Multistage Sankey
This variant connects flows across multiple phases. For instance, a supply chain visualization might go from Raw Materials to Manufacturing to Distribution to Retail. Here, the output of the first stage becomes the input of the second stage. This is powerful for identifying where volume is lost throughout a long process.
Circular or looped Sankey
These are rare and often used in recycling or economic models where resources are reused. A flow might leave the end of the chart and loop back to the beginning. These require specialized tools to render correctly, as standard tools often assume a linear progression.
Layered Sankey for categories
In this variant, the flows might be colored differently to represent distinct groups or cohorts that move through the same stages. This helps in tracking a specific segment, like a specific customer demographic, as they move through a general system.
Design best practices and pitfalls
Creating a Sankey diagram that’s easy to read requires more than just plugging in numbers. It requires design sensitivity. Here are some tips to keep your visuals clean and impactful.
Clarity and readability
- Use clear labels for nodes and flows: Make sure that every node is labeled directly. If space permits, include the value or percentage within the label so people don’t have to guess.
- Maintain a readable baseline orientation: Stick to left-to-right flow orientations unless you have a compelling reason not to. It reduces cognitive load for the viewer.
- Gridlines or background ticks: Adding subtle background markers can help people judge the flows’ proportions more accurately. While not always necessary, they can be a helpful guide.
Color usage
- Choose color meaningfully: Don’t just use random colors. Color-coding can represent categories. For example, you could make all renewable energy sources green, or show changes in state, like profitable flows in blue and losses in red.
- Make sure wide flows are differentiated: If you have two large flows next to each other, choose colors that provide enough contrast so they don’t blend into one massive blob.
Avoiding clutter
- Avoid excessive overlapping: Tangled flows are the enemy of clarity. Try to arrange your nodes vertically so that the connecting links cross over each other as little as possible.
- Don’t try to show too many nodes or paths in one Sankey: Prioritize the main flows. If you have 50 small flows that account for 1 percent of the total volume, group them into an “Other” category.
Examples and storytelling tips
To truly master Sankey diagrams, it helps to look at concrete examples of how they tell a story.
Example one: energy usage
Imagine a chart showing a country’s energy consumption. On the left, you have source fuels like Oil, Gas, Nuclear, and Renewables. In the middle, these flow into conversion sectors like Power Stations or Refineries. On the right, the flows disperse into Residential, Transport, and Industry. The most critical part of this chart is often the “Losses” or “Rejected Energy” flow, which usually exits the chart at the top or bottom. This visual instantly communicates how inefficient energy systems can be, which is a point that’s much harder to make with a table.
Example two: financial flow
A company might use a Sankey to show their annual budget. The left side lists revenue sources: Product Sales, Subscriptions, and Services. These flows merge into a central “Total Revenue” node or flow directly through and then split into expenses: Salaries, Marketing, R&D, and Operations. The remaining flow that lands in the “Profit” bucket at the end visually demonstrates the margin. If the stakeholder can see that the “Salaries” flow is twice as wide as the “Profit” flow, they can instantly understand the cost structure.
Example three: customer journey
A marketing team tracks leads. The left nodes are “Social Media,” “Direct Traffic,” and “Referrals.” These flow into a “Landing Page” node. From there, flows split into either “Bounced,” for people who left, or “Signed Up.” From “Signed Up,” flows go to “Active User” or “Churned.” Highlighting the width of the “Bounced” flow can galvanize a team to improve website design.
Storytelling tips
- Lead by explaining the major flows first: Start your explanation by pointing out the widest path. This anchors the viewer’s understanding.
- Highlight wide flows that represent the bulk of the data: Use callouts to draw attention to the heavy hitters.
- Annotate points where major splits or merges occur: Use text annotations to explain why a major split occurs. For example, “40 percent drop-off here due to paywall.”
How to create a Sankey diagram
Building a Sankey diagram requires data preparation and the right tools.
Data preparation
Regardless of the tool you use, the data structure is almost always the same. You need a simple list organized into three columns:
- Source: The starting point of the flow.
- Target: The ending point of the flow.
- Value: The numerical size of the flow.
You must check for consistency. If you have a multi-stage diagram, make sure the total outflow from the first stage matches the total inflow of the second stage, unless you’re intentionally showing data loss.
In Excel
Excel is the most common data tool, yet it has a significant limitation: There’s no native Sankey diagram button in standard, older versions of Excel. However, you can still create them using modern workarounds.
Using Excel add-ins
The most efficient way to build a Sankey in Excel is using the “Get Add-ins” feature.
- Go to the “Insert” tab and click “Get Add-ins.”
- Search for “Sankey.” You’ll see options like “Sankey Snip” or various visualizations from third-party developers.
- Add the visual to your sheet.
- Select your Source/Target/Value columns.
- The add-in will render the diagram.
Step-by-step for a basic add-in approach:
- Set up source/target/value table: Create columns A (Source), B (Target), and C (Value).
- Clean the data: Make sure the “Source” names are distinct from “Target” names. If you have “rent” as an income source and “rent” as an expense, the tool might get confused and create a loop. Rename them to “Rent Income” and “Rent Expense.”
- Insert Sankey add-in: Click your chosen Sankey add-in.
- Bind data: Click the “Select Data” button in the add-in and highlight your table range.
- Customize: Use the settings to change node colors. Make sure to adjust widths and layout for readability. Use consistent colors and add a descriptive title.
In BI tools or specialized software
If you need more power than Excel provides, dedicated business intelligence tools like Domo are often better.
- BI Tools: Most modern BI platforms have custom visuals or marketplace extensions for Sankey diagrams. You drag your “Source” field to the source bucket, “Target” to the destination bucket, and “Weight” to the value bucket.
- Specialized web tools: There are several free and paid web generators where you can paste your data set and generate an SVG or image download.
- Programming: Python libraries like Plotly allow for highly customizable, code-generated Sankey diagrams.
Interactivity and dashboards
Modern Sankey diagrams are often interactive.
- Hover tooltips: These allow people to hover over a flow and see the exact number, such as “543 users transferred here.”
- Filters: In a dashboard, you can add filters to show flows for only a specific year or region, reducing the visual complexity.
- Linking Sankey with tables or other charts: You can link the Sankey to other charts. Clicking a bar in a bar chart could highlight the relevant path in the Sankey diagram.
Limitations and when to use alternatives
Sankey diagrams aren’t a silver bullet. They have distinct limitations.
Clutter and complexity
The “spaghetti effect” is a real problem. If you have too many nodes or tiny flows, the chart becomes a mess of entangled lines that conveys no information. In these cases, you must aggregate the data or choose a different visual.
Directionality issues
If your data relationships aren’t directional, meaning there’s no clear “start” and “end,” a Sankey is the wrong choice. A chord diagram or a standard network graph might be better for showing non-directional relationships.
Alternatives
- Flowcharts when only sequence matters: Use these when the logic or sequence matters more than the volume. If you just need to show the steps of a login process without showing how many people take each step, a flowchart is superior.
- Stacked bar or waterfall charts for cumulative comparisons: These are better for cumulative comparisons or simple part-to-whole breakdowns where the “flow” aspect is less critical.
- Network graphs for complex interconnections without weighted flows: Ideal for complex interconnections where everything connects to everything else without a linear left-to-right progression.
Conclusion and key takeaways
Sankey diagrams are indispensable tools when you want to visualize flows where magnitude matters. They bridge the gap between hard data tables and abstract flowcharts, offering a clear view of how resources, people or money move through a system.
To succeed with Sankey diagrams, remember the best practices. Start with clean source, target, and value data sets. Limit your visible paths to the key flows that tell a story and use color purposefully to guide the eye. Avoid the temptation to include every single data point if it leads to clutter.
Ultimately, Sankey diagrams are ideal for showing where values go, not just what they are. By mastering this visual, you can turn static reports into dynamic stories of movement and transformation. We hope this guide gives you the power to explore your data in new and exciting ways.




