SPC In PowerPivot

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
88
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
I'm looking for a better way to calculate control limits for an SPC chart in PowerPivot.

I can do it with a small amount of data (~100 rows), however it is very inefficient and slow when doing it on a larger data set =(1000s of rows).

The formula to calculate the control limits is: Mean ± Mean moving range * 2.66 (where the MMR is the mean of the absolute difference between each value, in order)

The measures I am currently using to calculate this are:

Excel Formula:
Current Value:=
LASTNONBLANK(SPCData[Value],1)

Previous Value :=
CALCULATE (
    MAX ( SPCData[Value] ),
    FILTER ( ALLSELECTED ( SPCData ), SPCData[ID] < MAX ( SPCData[ID] ) )
)

Moving Range:=
IF(ISBLANK([Previous Value]),blank(), ABS([Current Value] - [Previous Value]))

Mean Moving Range:=
AVERAGEX(ADDCOLUMNS(ALLSELECTED(SPCData),"mr",[Moving Range]),[mr])

Mean:=
CALCULATE(AVERAGE(SPCData[Value]),ALLSELECTED(SPCData[ID]))

Upper Limit:=
[Mean]+[X Moving Range]*2.66

Lower Limit:=
[Mean]+[X Moving Range]*2.66

The simplest way to deal with it would be to have a calculated column with the moving range, however I want to slice it using various columns so this isn't possible.

I have included some sample data below:

IDValueCategory 1Category 2
1​
80.71259132​
AC
2​
70.16593087​
BC
3​
12.3173281​
AC
4​
11.17014753​
BC
5​
88.41041659​
AC
6​
62.00564824​
BD
7​
58.2748246​
AD
8​
80.37695074​
BD
9​
49.26807429​
AD

The way I am currently using it is in a pivot table with [ID] as rows and the 2 category columns as slicers. The values contain the measures [Current Value], [Mean], [Upper Limit] and [Lower Limit].

Any help is appreciated.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,813
Messages
6,181,115
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top