Forum Discussion

Ibrahim_shaik's avatar
1 year ago
Solved

How to create a Clustered, Stacked Column Chart

Hi Power Bi Community,   I Created a clustered and stacked column chart with a measure and a category table. but there is one issue with it I have to add a column in the X axis field and it shows i...
  • johnbasha33's avatar
    1 year ago

    Hi Ibrahim_shaik 

    You’ve got two different needs in one visual:

    1. Cluster by Group (Payable vs Receivable), and

    2. Stack by Category within each Group,
      but you only want Phase shown on the X-axis (no Group labels repeated under every Phase).

    Power BI’s built-in visuals can’t do “clustered + stacked” together, and most marketplace “clustered & stacked” visuals force a hierarchical X-axis (so you see both Phase and Group). Here are three workable solutions—pick the one that best fits your constraints:

    Option A — Deneb (Vega-Lite) custom visual (cleanest, full control)

    Deneb lets you build a true clustered-stacked chart and only show Phase on the axis.

    Data model expected:
    Fields: Phase (text), Group (Payable/Receivable), Category (your stack segments), Value (measure).

    Steps:

    1. Add the Deneb visual from AppSource.

    2. Bind your dataset (Phase, Group, Category, Value).

    Paste this Vega-Lite spec (it clusters by Group and stacks by Category, hides group labels, and shows only Phase):

    {
    "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
    "data": {"name": "dataset"},
    "encoding": {
    "x": {"field": "Phase", "type": "nominal", "axis": {"labelAngle": 0, "title": null}},
    "xOffset": {"field": "Group"},
    "y": {"field": "Value", "type": "quantitative", "stack": "zero", "axis": {"title": null}},
    "color": {"field": "Category", "type": "nominal"},
    "order": {"field": "Category"}
    },
    "mark": {"type": "bar"},
    "config": {
    "bar": {"size": 14},
    "axis": {"grid": false}
    }
    }

    • x = Phase (only Phase labels show)

    • xOffset = Group (creates the cluster within each Phase)

    • color = Category (creates the stack)

    • Adjust bar.size as needed.

    This gives you exactly what you described, without the duplicated “Payable/Receivable” labels on the axis.

    Option B — Two synced stacked column charts (no code, native)

    If you can’t use Deneb:

    1. Create two standard Stacked column charts with Axis = Phase, Legend = Category, Values = Value.

    2. Filter one visual to Group = Payable; filter the other to Group = Receivable (via visual-level filters).

    3. Place them side-by-side tightly to mimic clustering:

      • Turn off X-axis labels on the right visual, keep them on the left.

      • Turn off Y-axis on the right visual.

      • Match data colors and inner padding so columns align.

    You’ll see only Phase under the (left) axis; no repeated Group labels.

    Option C — “Positive/Negative” split (fastest, if acceptable)

    If your audience can read Payable vs Receivable as below/above zero:

    • Make Receivable values positive and Payable values negative (two measures or in Power Query).

    • Use a Stacked column chart with Axis = Phase, Legend = Category, Values = Value.

    • Color rules: positives (Receivable) one palette, negatives (Payable) another.

    This keeps only Phase on the axis; you lose side-by-side clustering but gain a clean single-axis view.

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!