Control Chart Builder
Paste measurements or defect counts to get a statistical process control chart: limits set from a stable baseline, the Western Electric rules checked on every new point, and process capability if you have spec limits. Then take the same chart into Power BI as DAX.
What are you charting?
Set the limits from a stable baseline period, then judge every later point against them. Blank uses every point, which lets a shift drag the limits toward itself.
First signal at S21: one point beyond a control limit (3σ); 2 of 3 points in a row beyond 2σ on the same side; 4 of 5 points in a row beyond 1σ on the same side. 8 more points flagged after it. Something changed in the process around then. Look for a special cause before adjusting anything.
Individuals chart
Moving range chart
The gap between each value and the one before it. The moving range sets the width of the limits above, so check it first. Only rule 1 applies here.
Process capability
From the within-sample sigma of 0.114 and the baseline center line. Cpk of 1.33 or more is the common target. The chart shows signals, so these numbers describe the baseline, not the process as it runs now.
Signals
| Point | Value | Rule |
|---|---|---|
| S21 | 24.380 | 1 one point beyond a control limit (3σ)2 2 of 3 points in a row beyond 2σ on the same side3 4 of 5 points in a row beyond 1σ on the same side |
| S22 | 24.230 | 3 4 of 5 points in a row beyond 1σ on the same side |
| S24 | 24.380 | 1 one point beyond a control limit (3σ) |
| S25 | 24.130 | 3 4 of 5 points in a row beyond 1σ on the same side |
| S26 | 24.140 | 3 4 of 5 points in a row beyond 1σ on the same side |
| S27 | 24.270 | 3 4 of 5 points in a row beyond 1σ on the same side |
| S28 | 24.070 | 4 8 points in a row on the same side of the center line |
| S29 | 24.150 | 3 4 of 5 points in a row beyond 1σ on the same side4 8 points in a row on the same side of the center line |
| S30 | 24.350 | 1 one point beyond a control limit (3σ)3 4 of 5 points in a row beyond 1σ on the same side4 8 points in a row on the same side of the center line |
| S21moving range | 0.440 | 1 moving range beyond its upper limit |
Every point as a table
| # | Label | Value | LCL | UCL | Rules |
|---|---|---|---|---|---|
| 1 | S01 | 24.020 | 23.664 | 24.348 | |
| 2 | S02 | 23.870 | 23.664 | 24.348 | |
| 3 | S03 | 23.850 | 23.664 | 24.348 | |
| 4 | S04 | 24.010 | 23.664 | 24.348 | |
| 5 | S05 | 23.980 | 23.664 | 24.348 | |
| 6 | S06 | 24.060 | 23.664 | 24.348 | |
| 7 | S07 | 23.750 | 23.664 | 24.348 | |
| 8 | S08 | 23.930 | 23.664 | 24.348 | |
| 9 | S09 | 23.880 | 23.664 | 24.348 | |
| 10 | S10 | 24.120 | 23.664 | 24.348 | |
| 11 | S11 | 24.080 | 23.664 | 24.348 | |
| 12 | S12 | 24.060 | 23.664 | 24.348 | |
| 13 | S13 | 23.980 | 23.664 | 24.348 | |
| 14 | S14 | 24.010 | 23.664 | 24.348 | |
| 15 | S15 | 24.050 | 23.664 | 24.348 | |
| 16 | S16 | 23.860 | 23.664 | 24.348 | |
| 17 | S17 | 24.220 | 23.664 | 24.348 | |
| 18 | S18 | 24.180 | 23.664 | 24.348 | |
| 19 | S19 | 24.270 | 23.664 | 24.348 | |
| 20 | S20 | 23.940 | 23.664 | 24.348 | |
| 21 | S21 | 24.380 | 23.664 | 24.348 | 1, 2, 3 |
| 22 | S22 | 24.230 | 23.664 | 24.348 | 3 |
| 23 | S23 | 24.090 | 23.664 | 24.348 | |
| 24 | S24 | 24.380 | 23.664 | 24.348 | 1 |
| 25 | S25 | 24.130 | 23.664 | 24.348 | 3 |
| 26 | S26 | 24.140 | 23.664 | 24.348 | 3 |
| 27 | S27 | 24.270 | 23.664 | 24.348 | 3 |
| 28 | S28 | 24.070 | 23.664 | 24.348 | 4 |
| 29 | S29 | 24.150 | 23.664 | 24.348 | 3, 4 |
| 30 | S30 | 24.350 | 23.664 | 24.348 | 1, 3, 4 |
The same chart in Power BI
Measures for the center line, control limits, and every rule you ticked, with the baseline you set. The moving range is a calculated column, because each row needs the one before it.
-- Measurements needs a SampleNo column numbered 1, 2, 3… in time order.
-- In Power Query: Add Column > Index Column > From 1.
-- One table, several machines or characteristics? Swap REMOVEFILTERS( 'Measurements' )
-- for ALLEXCEPT( 'Measurements', 'Measurements'[Machine] ) so each gets its own limits,
-- and add && 'Measurements'[Machine] = EARLIER( 'Measurements'[Machine] ) to the Moving Range FILTER.
-- Calculated column (Table tools > New column)
Moving Range =
VAR ThisSample = 'Measurements'[SampleNo]
VAR PrevValue =
MAXX( FILTER( 'Measurements', 'Measurements'[SampleNo] = ThisSample - 1 ), 'Measurements'[Value] )
RETURN
IF( NOT ISBLANK( PrevValue ), ABS( 'Measurements'[Value] - PrevValue ) )
Sample Value = AVERAGE( 'Measurements'[Value] )
Center Line =
CALCULATE(
AVERAGE( 'Measurements'[Value] ),
REMOVEFILTERS( 'Measurements' ),
'Measurements'[SampleNo] <= 20 -- limits from the baseline only
)
Average Moving Range =
CALCULATE(
AVERAGE( 'Measurements'[Moving Range] ),
REMOVEFILTERS( 'Measurements' ),
'Measurements'[SampleNo] <= 20 -- limits from the baseline only
)
-- 1.128 is d2 for a moving range of 2 points, so 3 sigma = 2.66 x MR-bar
Sigma = [Average Moving Range] / 1.128
UCL = [Center Line] + 3 * [Sigma]
LCL = [Center Line] - 3 * [Sigma]
-- Moving range chart
Moving Range Value = AVERAGE( 'Measurements'[Moving Range] )
MR UCL = 3.267 * [Average Moving Range]
-- Distance from the center line in sigmas; the run rules work on this
Z Score = DIVIDE( [Sample Value] - [Center Line], [Sigma] )
-- Which Western Electric rules this point completes, e.g. "Rule 1, 4"
Signal Rules =
VAR k = MAX( 'Measurements'[SampleNo] )
VAR Pts =
ADDCOLUMNS(
FILTER( ALL( 'Measurements'[SampleNo] ), 'Measurements'[SampleNo] > k - 8 && 'Measurements'[SampleNo] <= k ),
"@z", CALCULATE( [Z Score] )
)
VAR z = MAXX( FILTER( Pts, 'Measurements'[SampleNo] = k ), [@z] )
VAR Last3 = FILTER( Pts, 'Measurements'[SampleNo] > k - 3 )
VAR Last5 = FILTER( Pts, 'Measurements'[SampleNo] > k - 5 )
VAR R1 = ABS( z ) > 3
VAR R2 =
( z > 2 && COUNTROWS( FILTER( Last3, [@z] > 2 ) ) >= 2 )
|| ( z < -2 && COUNTROWS( FILTER( Last3, [@z] < -2 ) ) >= 2 )
VAR R3 =
( z > 1 && COUNTROWS( FILTER( Last5, [@z] > 1 ) ) >= 4 )
|| ( z < -1 && COUNTROWS( FILTER( Last5, [@z] < -1 ) ) >= 4 )
VAR R4 =
k >= 8
&& ( COUNTROWS( FILTER( Pts, [@z] > 0 ) ) = 8 || COUNTROWS( FILTER( Pts, [@z] < 0 ) ) = 8 )
VAR Fired =
SUBSTITUTE( TRIM( IF( R1, "1 " ) & IF( R2, "2 " ) & IF( R3, "3 " ) & IF( R4, "4 " ) ), " ", ", " )
RETURN
IF( HASONEVALUE( 'Measurements'[SampleNo] ) && NOT ISBLANK( z ) && Fired <> "", "Rule " & Fired )
-- Plot as a second line with markers only, to put a red dot on each signal
Signal Point = IF( NOT ISBLANK( [Signal Rules] ), [Sample Value] )
-- Process capability: only meaningful once the chart shows no signals
Cpu = DIVIDE( 24.5 - [Center Line], 3 * [Sigma] )
Cpl = DIVIDE( [Center Line] - 23.5, 3 * [Sigma] )
Cp = DIVIDE( 24.5 - 23.5, 6 * [Sigma] )
Cpk = MIN( [Cpu], [Cpl] )- Add a line chart with
SampleNoon the X-axis, and set the axis type to Categorical so every point shows. - Put
Sample Value,Center Line,UCL, andLCLon the Y-axis. Make the limits dashed under Format > Lines. - Add
Signal Pointto the Y-axis too, set its line width to 0, turn on its markers, and color them red. PutSignal Rulesin the tooltips. - Build a second line chart underneath for the moving range, from
Moving Range Valueand its limits. Keep it a separate chart: the two have different scales, so they shouldn't share an axis.
The rules work on Z Score, so they behave the same on a p chart whose limits change with sample size. Each rule flags the point that completes the pattern, the same convention this page uses. More on the measures behind it in CALCULATE and ALL and REMOVEFILTERS.
Free, with no sign-in and no request limit. Everything runs in your browser, and nothing you paste is sent anywhere.
Which chart? Use I-MR when you get one measurement at a time (a daily reading, one part per batch). Use X̄-R when you measure a few parts together, say five every hour: averaging a subgroup makes small shifts easier to see. Use a p chart when each unit simply passes or fails and you count the failures.
Control limits aren't spec limits. Control limits come from the process's own variation and say whether it's behaving the way it used to. Spec limits come from the customer or the drawing and say whether a part is acceptable. A process can be in control and still make bad parts, which is what Cpk measures, or out of control while every part is still in spec.
Why the limits aren't the standard deviation. The sigma comes from the moving range or the subgroup ranges, not the standard deviation of all the data. Ranges measure short-term variation only, so a shift in the middle of the data doesn't widen the limits and hide itself.
Building it in Power BI? The SPC control chart tutorial walks through the I-MR example step by step: the moving range column, baseline limits, the rules measure, and Cp/Cpk, with the same numbers this tool shows.
More engineering calculators: the Reliability Calculator and the FMEA Calculator. Or browse all the Power BI tools.