Tutorial

How to Build a Sankey Diagram in Power BI (2026)

· VizForge Team

TL;DR

Power BI has no native Sankey visual. You have three options in 2026: (1) install a free marketplace Sankey from AppSource — fastest but visually generic; (2) use Deneb with a Vega-Lite spec — free but requires learning Vega-Lite; (3) generate a custom Sankey from a plain-English prompt with VizForge — no spec language, own the TypeScript source. This post walks through each with working code, pros and cons, and the DAX measures you'll need.

Sankey diagrams are the right visual for flow: customer journeys, budget cascades, energy audits, headcount movement. Native Power BI doesn't ship one. Microsoft's AppSource marketplace has several; the open-source Deneb visual can render a Sankey from a Vega-Lite JSON spec; and VizForge can generate a custom Sankey .pbiviz from a plain-English description. Each option fits a different situation.

When a Sankey is the right visual

Reach for a Sankey when your data describes quantities flowing between named stages or nodes. Classic use cases:

- Customer journey: acquisition channel → onboarding step → conversion or churn - Budget cascade: total revenue → segment → cost bucket → net margin - Energy or material flow: source → intermediate → output - Employee movement: starting department → promoted / transferred / exited

If the flows are bidirectional or form a closed system (migration between regions, trade between countries), a chord diagram is usually clearer than a Sankey. If the flows go through strict stages with drop-off at each, a standard funnel is more compact.

Option 1 — AppSource marketplace Sankey

The fastest path is the free Sankey by MAQ Software (search "Sankey Bar Chart" on AppSource). Install it into Power BI Desktop via Visualizations pane → three-dot menu → "Get more visuals". It takes three columns — Source, Target, Weight — and renders a standard left-to-right Sankey with default teal-to-purple ribbons.

Pros: free, fast, installs in under a minute. Cons: fixed color palette (fights most corporate themes), limited label-placement control, no support for hierarchical flows past three levels, and the visual updates push on Microsoft's schedule so you can't version-lock your report's appearance.

For an ad-hoc chart inside a one-off report, this is usually the right call. For a polished, brand-matched Sankey in a dashboard you ship to stakeholders, keep reading.

Option 2 — Deneb + Vega-Lite

Deneb is a free open-source Power BI custom visual that renders any Vega-Lite or Vega spec. The learning curve is steep — Vega-Lite is its own declarative grammar — but once you're fluent the ceiling is essentially unlimited.

Here's a minimal Sankey spec that renders a two-level flow from acquisition channel to conversion outcome. Paste this into a Deneb visual's spec editor, bind your data to the 'dataset' key, and you have a working Sankey.

sankey-spec.json

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "data": [
    {
      "name": "dataset",
      "values": [
        { "source": "Search",   "target": "Converted", "value": 142 },
        { "source": "Search",   "target": "Churned",   "value":  38 },
        { "source": "Referral", "target": "Converted", "value":  89 },
        { "source": "Referral", "target": "Churned",   "value":  11 },
        { "source": "Social",   "target": "Converted", "value":  47 },
        { "source": "Social",   "target": "Churned",   "value":  29 }
      ]
    }
  ],
  "signals": [
    { "name": "width",  "value": 600 },
    { "name": "height", "value": 320 }
  ],
  "marks": [
    {
      "type": "group",
      "from": { "data": "dataset" },
      "encode": {
        "enter": {
          "x":     { "value": 0 },
          "x2":    { "signal": "width" },
          "y":     { "value": 0 },
          "y2":    { "signal": "height" }
        }
      }
    }
  ]
}

Deneb — the real-world tradeoffs

Vega-Lite gives you precision but costs time. A Sankey spec you'd actually ship (sorted flows, label rotation, color-coded by flow type, tooltips) runs 150–300 lines of JSON. Debugging errors requires reading Vega runtime messages. Upgrading across Vega-Lite major versions occasionally breaks specs.

If your analytics team already knows Vega-Lite, Deneb is excellent and free. If learning Vega-Lite is not a good use of your analyst's time, move to option 3.

Option 3 — Generate a custom Sankey with VizForge

VizForge generates a Power BI custom visual from a plain-English prompt. For a Sankey, you describe the chart you want — data shape, styling, interactions — and the AI produces a .pbiviz file that imports directly into Power BI Desktop. You own the TypeScript source and can modify freely.

A working prompt for a branded multi-level Sankey:

"Sankey diagram showing customer flow from 5 acquisition channels
through 3 onboarding steps to either Converted or Churned. Left-align
node labels, use a blue-to-green gradient for converted paths and red
for churn. Labels show percentage of total flow. Animate ribbon
entrance on load."

DAX measures that pair with a Sankey

Whichever option you choose, the DAX you write is the same. The Sankey visual expects three columns — Source, Target, Value — which you build from your transactional data.

For a customer-journey Sankey, the minimal measure set is:

sankey-measures.dax

Total Flow = SUMX( Journey, Journey[Count] )

Flow to Converted =
    CALCULATE(
        [Total Flow],
        Journey[Target] = "Converted"
    )

Flow to Churned =
    CALCULATE(
        [Total Flow],
        Journey[Target] = "Churned"
    )

Conversion Share =
    DIVIDE( [Flow to Converted], [Total Flow] )

Data-shape pitfalls to avoid

Three common mistakes kill most first Sankey attempts in Power BI:

1. **Using rollups instead of raw flows.** If your Source and Target columns are pre-aggregated by month, the Sankey won't cross-filter correctly. Keep the grain at the individual row level and aggregate in the visual's measure.

2. **Long-tail category values.** Sankeys read cleanly with 5–15 nodes per level. Bucket long-tail categories into "Other" in a calculated column before visualizing.

3. **Feedback loops.** Standard Sankey layouts assume acyclic flow. If your data has cycles (users who churn then reactivate), either model them as separate nodes (Churned vs. Reactivated) or switch to a chord diagram.

Which option should you pick?

Three-minute decision guide: (a) Need a Sankey today in an ad-hoc report? Install the AppSource MAQ Sankey. (b) Your team writes Vega-Lite or you need infinite design control? Deneb. (c) You need a Sankey matched to brand, without learning a new grammar, and you want to own the source code? VizForge.

If your organization already runs many Power BI reports, you'll likely want all three available. Each is a .pbiviz that coexists in the same Power BI environment.

Generate your custom Sankey with VizForge

Free plan: 3 visuals per month. No credit card. Own the .pbiviz source.

FAQ

Can I build a Sankey without any custom visual?

No. Native Power BI has no Sankey type. The built-in charts won't approximate one because the Sankey's ribbon geometry is fundamentally different from bar, line, or area charts.

Will a Sankey work in Power BI Service (published reports)?

Yes. All three options — MAQ, Deneb, VizForge — render as Power BI custom visuals that work identically in Desktop and Service. Publishing a report does not change the visual's behavior.

How many stages (levels) can a Sankey show?

Technically unlimited; practically 3–5 levels stay readable. Past that, ribbons become hair-thin and labels collide. Consider breaking a deep hierarchy into two Sankeys side by side, or using a sunburst instead.

Does a Sankey support cross-filtering with other visuals?

Depends on the implementation. MAQ's Sankey cross-filters. Deneb's does if the spec explicitly handles selection. VizForge-generated Sankeys include SelectionManager integration by default.

Can the Sankey auto-sort nodes by total flow?

MAQ sorts alphabetically by default with no override. Deneb sorts however your spec says. VizForge follows whatever you describe in the prompt — descending by total flow is a common request.

Related reading

Cite this article as:

VizForge. “How to Build a Sankey Diagram in Power BI (2026).” April 23, 2026. https://vizforge.ai/blog/how-to-build-sankey-diagram-power-bi

Your next visual
ships in 4–10 min.

Sign up free. 5 credits to generate your first visuals on us. No credit card required.