Power BI How-To
How to make an SPC control chart in Power BI
Build an SPC control chart in Power BI: field wells, a worked example, when the native visual is enough, and how to generate the .pbiviz without code.
By Nawaf Sharaf · Founder & Reliability Engineer · Updated
A statistical process control (SPC) chart plots a process metric over time with its mean and control limits (usually ±3σ), so a reader can tell routine variation from a real shift. Manufacturing, healthcare quality and service operations use it to stop reacting to noise and start reacting to signals.
Power BI has nothing native for SPC; a line chart with constant lines from the Analytics pane gets you a mean and fixed limits but not sigma bands, rule violations or a baseline window. This guide builds one from a two-column series, explains the baseline-window decision that everything depends on, and shows how to make Western Electric rule flags visible and auditable.
Step-by-step
- 1
Shape the data for the SPC control chart
Two columns: Date (date) and Value (numeric). Window for mean and sigma calculation either fixed (first N points) or rolling — specify in the prompt. In the finished visual those columns land in the Date, Value, Baseline flag, Annotation wells, so name them that way from the start.
- 2
Load a small sample into Power BI Desktop
Import at least 20 consecutive baseline days flagged 1 before any test days flagged 0, as in the example. Fewer baseline points give limits too wide to flag the 27 March spike.
- 3
Describe the SPC control chart and generate the .pbiviz
On VizForge, describe the chart in plain English and say what matters for this one: chart type: individuals (I), X-bar with subgroup size, moving range, p-chart or c-chart; baseline: first N points, a flag column, or rolling; and whether limits recalculate on filter; which Western Electric rules to evaluate and how to mark each (colour, shape, label). The pipeline writes the TypeScript, type-checks it and packages a .pbiviz.
- 4
Import the .pbiviz into Power BI Desktop
In the Visualizations pane, open the three-dot menu, choose Import a visual from a file and select the .pbiviz. The visual appears in the gallery; add it to the page like any built-in chart.
- 5
Bind the field wells
Date: Date or sequence column: the X axis. Value: Numeric measure: the plotted point (defect count, AHT, infection rate). Baseline flag: Optional flag column: which points define the mean and limits. Annotation: Optional text column: a cause note shown on flagged points.
- 6
Check the first render, then format
Limits that move when you change a slicer: no baseline flag is bound, so limits follow the visible window. Every point flagged: the Value is a running total rather than a per-period figure. Then open the formatting pane and set mean, UCL and LCL line colours, widths and dash styles.
Field wells the generated SPC control chart exposes
After import, these are the data roles you drop fields into. The names come from the visual’s capabilities.json, which you can rename before packaging if your team uses different terms.
| Well | Takes | Note |
|---|---|---|
| Date | Date or sequence column: the X axis. | Use a date table so the sequence is complete; a missing day shifts every run-length rule. |
| Value | Numeric measure: the plotted point (defect count, AHT, infection rate). | One point per period; aggregate subgroups in DAX for X-bar charts. |
| Baseline flag | Optional flag column: which points define the mean and limits. | Without it, limits are computed over the visible window and move with every filter. |
| Annotation | Optional text column: a cause note shown on flagged points. | Lets the chart carry the investigation, not just the alarm. |
Worked example
Daily defects on a packaging line, with the first 20 days as the baseline.
| Date | Defects | Baseline |
|---|---|---|
| 2026-03-01 | 14 | 1 |
| 2026-03-02 | 11 | 1 |
| ... | ... | ... |
| 2026-03-21 | 13 | 0 |
| 2026-03-27 | 27 | 0 |
| 2026-03-28 | 26 | 0 |
What the chart draws: A line with a mean of about 12.4 and UCL of about 23 from the baseline days, lighter 1σ and 2σ bands, and 27 March flagged red for breaching the UCL; 28 March is also flagged as the second of a 2-of-3-beyond-2σ run.
Live preview
The AI alternative: Describe your SPC control chart in plain English and VizForge generates the .pbiviz, source included. 5 free credits on signup, no card required.
Generate an SPC control chart on VizForge →Without code: what to put in the prompt
The generator turns a description into the TypeScript, so the description is where the decisions live. For an SPC control chart, say:
- Chart type: individuals (I), X-bar with subgroup size, moving range, p-chart or c-chart.
- Baseline: first N points, a flag column, or rolling; and whether limits recalculate on filter.
- Which Western Electric rules to evaluate and how to mark each (colour, shape, label).
- Sigma bands shown (1σ, 2σ, 3σ) and their shading.
- Whether a phase change should recompute limits from that point on.
Example VizForge prompt
SPC control chart (X-bar, individuals). Plot daily defect count with mean, 3-sigma UCL and LCL, 1-sigma and 2-sigma bands in lighter shading. Flag points outside UCL in red; annotate runs of 7+ consecutive points on one side of the mean.
Customise it: formatting options worth exposing
Anything you name as adjustable becomes a card in Power BI’s formatting pane, which a report theme can then set for every copy of the visual. For an SPC control chart the options that earn their place are:
- Mean, UCL and LCL line colours, widths and dash styles.
- Band shading colours and opacity for 1σ/2σ.
- Violation marker colour per rule.
- Point size and whether to connect points.
- Label format and placement for limit values on the right edge.
For changes the pane doesn’t cover, edit settings.ts and visual.ts in the source that ships with the download and repackage; or refine on VizForge and get a v2 that keeps everything you didn’t mention.
When native Power BI is enough (as of November 2026)
Power BI has no native SPC chart. A line chart with constant lines (mean, UCL, LCL typed in or from measures via the Analytics pane) is enough when limits are fixed, you don't need sigma bands or rule flags, and the audience knows what the lines mean. The moment you need rule-based flags (points beyond 3σ, runs of eight on one side), a frozen baseline, or stage changes, you need a chart that computes them.
Limits of Marketplace SPC control chart visuals
Marketplace SPC visuals typically implement the basic Shewhart chart and a subset of the Western Electric rules, with the rule set fixed by the vendor. Baseline handling (fixed window vs. all visible points) is usually not configurable, which changes the limits every time a slicer moves. Annotations on flagged points and chart types beyond I/X-bar are the features most often missing or paid.
The general trade-offs (per-user licensing, closed source, no new field wells) are the same for every chart type; see VizForge vs Microsoft Marketplace visuals for the full comparison.
Download, install and first render
The download is a standard .pbiviz plus the TypeScript source. Import it in Power BI Desktop (Visualizations pane → three dots → Import a visual from a file), add it to the page and bind the wells above. Then check the SPC control chart against this list before you connect the full dataset:
- Limits that move when you change a slicer: no baseline flag is bound, so limits follow the visible window.
- Every point flagged: the Value is a running total rather than a per-period figure.
- Gaps in the line: dates missing from the date table; mark the dimension 'Show items with no data' or fill the calendar.
- LCL below zero for a count chart: clamp it to zero in the visual settings, as a c-chart requires.
When to use an SPC control chart
- Manufacturing yield and defect-rate monitoring
- Healthcare quality metrics (readmission rate, infection rate)
- Call-center AHT (average handle time) tracking
- Web service SLA tracking with process-shift detection
- Financial reconciliation variance monitoring
Frequently asked questions
Will the visual work in Power BI Service, Premium and embedded reports?
Yes. A .pbiviz is a standard Power BI custom visual and renders the same in Desktop, the Service, Premium and Premium per User capacities, and embedded scenarios. Tenant admins can restrict custom visuals to certified or organisational ones; if yours does, publish the .pbiviz as an organisational visual rather than importing it per report.
What if I need to change the visual later?
Two paths. Refine on VizForge with an instruction such as "add a target line" and get a v2 .pbiviz that keeps everything you didn't mention; or open the TypeScript source that ships with every download in VS Code, edit it and repackage with pbiviz package.
Which control-chart types are supported?
Individuals (I-chart), X-bar (with subgroup size), moving range (MR), p-chart (proportion defective), and c-chart (count). Prompt for the type you need.
Which Western Electric rules?
All 8 standard rules (point beyond 3σ, 2-of-3 beyond 2σ, 4-of-5 beyond 1σ, 8 on one side, 6 trending, 14 alternating, 15 within 1σ, 8 outside 1σ). Prompt to toggle specific ones.
Fixed or rolling control limits?
Either. Rolling limits adapt as new data comes in; fixed limits freeze after a baseline period. VizForge supports both — specify in the prompt.
Can I annotate causes on violations?
Yes. Bring a Notes column and the visual shows a tooltip with your cause analysis on flagged points.
Put your SPC control chart on a designed page
Free Design Studio page layouts. Download the background, theme and PBIP project, then import the visual into the slot.
Manufacturing template
Manufacturing OEEHas a slot for it: “OEE by shift”.
Supply chain template
Logistics & DeliveryHas a slot for it: “On-time % by week”.
IT template
IT Service DeskHeader band, 5 KPIs, trend + gauge + donut, full-width breach-risk table
Design the page around it, free
A custom visual looks best on a designed page. The free VizForge Design Studio lays out a branded report page at Power BI’s pixel size and exports the background image, a theme JSON and a PBIP project. No signup.
Open the free Design Studio →Guides for related charts
Reference
Data shape, DAX measures, related visuals.
Index
One guide per Power BI visual type, plus the Design Studio guides.
VizForge — AI-generated Power BI custom visuals.