New: free Power BI model health check. Find what's making your numbers wrong and your model slow. Check your model →

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.

Western Electric rules
Center line (X̄)24.006
UCL24.348
LCL23.664
Signals9of 30 points

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

23.824.024.224.4S01S03S05S07S09S11S13S15S17S19S21S23S25S27S29BaselineMonitoringUCL 24.348CL 24.006LCL 23.6641,2,33133343,41,3,4
Measured valueControl limits (3σ)1σ and 2σ zonesSignal, labeled with the rule number

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.

0.00.20.4S03S05S07S09S11S13S15S17S19S21S23S25S27S29BaselineMonitoringUCL 0.420CL 0.128LCL 0.0001

Process capability

Cp1.46spread vs. spec width
Cpk1.45also counts centering
Cpl1.48
Cpu1.45

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

PointValueRule
S2124.3801 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
S2224.2303 4 of 5 points in a row beyond 1σ on the same side
S2424.3801 one point beyond a control limit (3σ)
S2524.1303 4 of 5 points in a row beyond 1σ on the same side
S2624.1403 4 of 5 points in a row beyond 1σ on the same side
S2724.2703 4 of 5 points in a row beyond 1σ on the same side
S2824.0704 8 points in a row on the same side of the center line
S2924.1503 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
S3024.3501 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 range0.4401 moving range beyond its upper limit
Every point as a table
#LabelValueLCLUCLRules
1S0124.02023.66424.348
2S0223.87023.66424.348
3S0323.85023.66424.348
4S0424.01023.66424.348
5S0523.98023.66424.348
6S0624.06023.66424.348
7S0723.75023.66424.348
8S0823.93023.66424.348
9S0923.88023.66424.348
10S1024.12023.66424.348
11S1124.08023.66424.348
12S1224.06023.66424.348
13S1323.98023.66424.348
14S1424.01023.66424.348
15S1524.05023.66424.348
16S1623.86023.66424.348
17S1724.22023.66424.348
18S1824.18023.66424.348
19S1924.27023.66424.348
20S2023.94023.66424.348
21S2124.38023.66424.3481, 2, 3
22S2224.23023.66424.3483
23S2324.09023.66424.348
24S2424.38023.66424.3481
25S2524.13023.66424.3483
26S2624.14023.66424.3483
27S2724.27023.66424.3483
28S2824.07023.66424.3484
29S2924.15023.66424.3483, 4
30S3024.35023.66424.3481, 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] )
  1. Add a line chart with SampleNo on the X-axis, and set the axis type to Categorical so every point shows.
  2. Put Sample Value, Center Line, UCL, and LCL on the Y-axis. Make the limits dashed under Format > Lines.
  3. Add Signal Point to the Y-axis too, set its line width to 0, turn on its markers, and color them red. Put Signal Rules in the tooltips.
  4. Build a second line chart underneath for the moving range, from Moving Range Value and 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.