How to Make a Sankey Diagram in Power BI

Cody Schneider

A Sankey diagram is one of the best ways to show how something moves from one stage to another. Whether you're tracking a customer's journey through your website or visualizing how your ad budget is spent, this type of chart makes complex flows easy to understand at a glance. This guide will walk you through exactly how to prepare your data and build a clear, insightful Sankey diagram directly within Power BI.

What is a Sankey Diagram and When Should You Use It?

Think of a Sankey diagram as a flow map. It uses links, or bands, to connect different stages, called nodes. The width of these bands is proportional to the flow quantity - a wider band means a larger value is moving between those two nodes.

This makes them excellent for answering questions about movement and distribution. While a bar chart can show you your top traffic sources, a Sankey can show you where that traffic goes next. It reveals the complete path, not just the start and end points.

Some great use cases for a Sankey diagram include:

  • Website User Flow: Show how users move from traffic sources (e.g., Google, Social Media) to different pages on your site (Homepage, Pricing, Contact Us) and eventually to a conversion goal.

  • Marketing Funnel Analysis: Visualize the customer journey from an initial ad click, to a landing page visit, to a lead submission, and finally to a closed deal.

  • Budget Allocation: Track how a total budget is split between departments, then further divided into specific campaigns or projects.

  • Sales Pipeline Stages: Illustrate how leads progress from "New" to "Contacted," "Qualified," and "Won" or "Lost," highlighting where the biggest drop-offs occur.

Preparing Your Data for a Sankey Diagram

Before you can build anything in Power BI, your data needs to be in the right format. This is the most important step. For a Sankey diagram to work, your dataset must have three core columns:

  1. Source: The starting point of the flow.

  2. Destination: The ending point of the flow.

  3. Value (or Weight): The amount that is flowing between the source and destination.

Each row in your table should represent a single flow from one node to another. For example, if you're analyzing web traffic, your data might look something like this:

Example Web Traffic Data:

Source

Destination

Users

Organic Search

Homepage

15,000

Paid Social

Landing Page A

9,500

Homepage

Pricing Page

8,200

Landing Page A

Sign Up Form

4,100

Pricing Page

Sign Up Form

3,500

In this example, "Source" is the starting page/channel, "Destination" is the next page users went to, and "Users" is the value that defines the width of the flow. Before you load this into Power BI, make sure your category names ("Source" and "Destination") are consistent. For instance, "Homepage" and "Home Page" would be treated as two different nodes, which would incorrectly split your flow.

Step-by-Step Guide to Creating a Sankey Diagram in Power BI

Unlike standard bar or line charts, the Sankey diagram is not a native Power BI visual. You’ll need to add it from AppSource, Microsoft’s marketplace for custom visuals. It just takes a few clicks.

Step 1: Get the Sankey Custom Visual

First, load your prepared data into your Power BI report. Once your data is ready, navigate to the Visualizations pane on the right side of the screen.

  1. Click the three dots (...) at the bottom of the Visualizations pane.

  2. Select Get more visuals from the menu.

  3. This opens the AppSource window. In the search bar at the top, type "Sankey".

  4. You'll see a few options. The most popular and well-supported one is Sankey by MAQ Software. Click Add next to it.

  5. Once installed, a new icon for the Sankey diagram will appear in your Visualizations pane.

Step 2: Add the Visual to Your Report and Map Your Data

Now that the visual is available, you can add it to your report canvas.

  1. Click the new Sankey icon in the Visualizations pane. A blank chart placeholder will appear on your report.

  2. With the blank visual selected, look at the fields required in the Visualizations pane: Source, Destination, and Weight.

  3. From your Data pane, drag your "Source" column into the Source field.

  4. Drag your "Destination" column into the Destination field.

  5. Finally, drag your "Users" column (like "Sessions" or "Traffic") into the Weight field.

Just like that, your Sankey diagram will appear, showing the flows defined in your data table.

Customizing Your Sankey Diagram for Clarity and Impact

A default chart gets the job done, but a little formatting can turn it from a simple visual into a powerful storytelling tool. With your Sankey diagram selected, click the paintbrush icon (Format your visual) in the Visualizations pane to start customizing.

1. Adjusting Links and Nodes

  • Link Colors: Under the Links section, you can change the color of the flows. You can set a single color for all links or use conditional formatting based on the source, destination, or value.

  • Node Styling: In the Nodes section, you can enable labels to see the name of each stage clearly. You can also adjust the label font size and color for better readability.

2. Controlling Data Labels

  • Data Labels: Turning these on will display the total value flowing into each node, which can provide helpful context.

  • Link Labels: This is a key setting. Under Link labels, you can toggle on a switch to show the value of each individual flow directly on the link itself. This removes the need for your audience to guess the size of a flow.

3. Managing Complex Flows

  • Settings for Cycles: What if a user goes from the Homepage back to the Homepage? This is a "self-link" or a "cycle." In the Settings section, you have options to handle this. You can enable Draw backward link to visualize it or simply toggle off Self-links to hide them and keep the chart clean.

  • Scaling: If your dataset has a few very large flows and many small ones, the small ones may become practically invisible. The Scale settings menu allows you to switch to a logarithmic scale, which can help make these smaller flows more visible. Use this with caution, as it can be misleading if not clearly noted.

Common Pitfalls and Tips for Success

As you build your Sankey diagram, you might run into a few common issues. Here’s how to troubleshoot them.

Problem: The Chart Looks Overly Complicated or "Spidery"

This usually happens when you have too many nodes or too many small, insignificant flows. A Sankey diagram is meant to show the big picture. If it's too cluttered to read, consider simplifying your data. You could group smaller categories together (e.g., combining "Bing," "Yahoo," and "DuckDuckGo" into an "Other Search Engines" category) or use a Power BI filter to focus only on the largest, most important flows.

Problem: Flows Are Crossing and Tangled

Modern Sankey visuals are pretty good at arranging nodes to minimize crossover. However, you can sometimes influence the layout by dragging and dropping the nodes directly on the chart canvas to rearrange their vertical order. Placing related nodes closer together can often untangle complex views.

Problem: The Chart Shows an Error About Circular References

This is related to the cycles mentioned earlier. It means you have a logical loop in your data, like Flow A -> Flow B -> Flow A. Check the toggle in the Settings pane of the formatting options to ensure you're either visualizing or ignoring these cycles as intended.

Quick Tip: Use Tooltips for More Detail

You can add more context without cluttering the visual itself. Drag additional data fields into the Tooltips bucket in the Visualizations pane. Now, when a user hovers over a flow or a node, they can see extra information, like the exact percentage of total traffic that flow represents or the conversion rate for that specific path.

Final Thoughts

Sankey diagrams are an exceptional tool for visualizing processes and uncovering insights about how things move through a system. By structuring your data correctly and using Power BI's custom visual marketplace, you can build compelling, easy-to-read flow charts that clearly explain complex funnels and journeys to anyone on your team.

While Power BI offers deep customization, the process of importing custom visuals, structuring data, and configuring dashboards still takes time. At Graphed, we aim to eliminate that setup time entirely. You can connect your marketing and sales data sources in seconds and simply ask, "Show me a flow chart of my website traffic for last month," using plain English. We turn your request into a live, real-time visualization instantly, so you can spend less time building reports and more time acting on what your data is telling you.