As the next step of my control chart project I realise I need to calculate the average of the Moving Range of a group of values in my Pivot Table.
Wikipedia defines the calculation formula here:
https://en.wikipedia.org/wiki/Shewhart_individuals_control_chart
As a first step I have created an Index column in my data using Power Query. Next I tried to test the use of EARLIER to find the minimum of one value and its neighbour in the next row. However this is where it gets stuck.
Any help with the measure I am using would be appreciated please or advice as to whether I should be taking a different tack. I have been reluctant to try and create calculated columns in my data source as just even adding the index column has increased the file size by 20%.
The measure I've tried is:
=CALCULATE(MIN(QryAnalysis[Value]),FILTER(QryAnalysis,QryAnalysis[Oxide]=EARLIER(QryAnalysis[Oxide]) && QryAnalysis[Index]=EARLIER((QryAnalysis[Index]) && QryAnalysis[Index]=EARLIER(QryAnalysis[Index])+1)))
The error is:
"This formula is invalid or incomplete: 'Calculation error in measure 'QryAnalysis'[Minimum of two values]: EARLIER/EARLIEST refers to an earlier row context which doesn't exist.'. "
My Pivot Table looks like:
[TABLE="width: 288"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Oxide[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Na2O %[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Average Value[/TD]
[/TR]
[TR]
[TD]Sample Date[/TD]
[TD]Index[/TD]
[TD]Amber[/TD]
[/TR]
[TR]
[TD="align: right"]03/04/2017
[/TD]
[TD="align: right"]132950[/TD]
[TD="align: right"]11.97[/TD]
[/TR]
[TR]
[TD="align: right"]10/04/2017
[/TD]
[TD="align: right"]132951[/TD]
[TD="align: right"]12.00[/TD]
[/TR]
[TR]
[TD="align: right"]18/04/2017[/TD]
[TD="align: right"]132952[/TD]
[TD="align: right"]11.96[/TD]
[/TR]
[TR]
[TD="align: right"]24/04/2017[/TD]
[TD="align: right"]132953[/TD]
[TD="align: right"]12.09[/TD]
[/TR]
[TR]
[TD="align: right"]02/05/2017[/TD]
[TD="align: right"]132954[/TD]
[TD="align: right"]12.11[/TD]
[/TR]
[TR]
[TD="align: right"]08/05/2017[/TD]
[TD="align: right"]132955[/TD]
[TD="align: right"]12.07[/TD]
[/TR]
[TR]
[TD="align: right"]15/05/2017[/TD]
[TD="align: right"]132956[/TD]
[TD="align: right"]12.08[/TD]
[/TR]
[TR]
[TD="align: right"]22/05/2017
[/TD]
[TD="align: right"]132957[/TD]
[TD="align: right"]12.08
[/TD]
[/TR]
[TR]
[TD="align: right"]29/05/2017
[/TD]
[TD="align: right"]132958[/TD]
[TD="align: right"]11.98[/TD]
[/TR]
</tbody>[/TABLE]
Should I plough on? My next measure would be to work out the Max, then AVERAGEX MAX- MIN.
Wikipedia defines the calculation formula here:
https://en.wikipedia.org/wiki/Shewhart_individuals_control_chart
As a first step I have created an Index column in my data using Power Query. Next I tried to test the use of EARLIER to find the minimum of one value and its neighbour in the next row. However this is where it gets stuck.
Any help with the measure I am using would be appreciated please or advice as to whether I should be taking a different tack. I have been reluctant to try and create calculated columns in my data source as just even adding the index column has increased the file size by 20%.
The measure I've tried is:
=CALCULATE(MIN(QryAnalysis[Value]),FILTER(QryAnalysis,QryAnalysis[Oxide]=EARLIER(QryAnalysis[Oxide]) && QryAnalysis[Index]=EARLIER((QryAnalysis[Index]) && QryAnalysis[Index]=EARLIER(QryAnalysis[Index])+1)))
The error is:
"This formula is invalid or incomplete: 'Calculation error in measure 'QryAnalysis'[Minimum of two values]: EARLIER/EARLIEST refers to an earlier row context which doesn't exist.'. "
My Pivot Table looks like:
[TABLE="width: 288"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Oxide[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Na2O %[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Average Value[/TD]
[/TR]
[TR]
[TD]Sample Date[/TD]
[TD]Index[/TD]
[TD]Amber[/TD]
[/TR]
[TR]
[TD="align: right"]03/04/2017
[/TD]
[TD="align: right"]132950[/TD]
[TD="align: right"]11.97[/TD]
[/TR]
[TR]
[TD="align: right"]10/04/2017
[/TD]
[TD="align: right"]132951[/TD]
[TD="align: right"]12.00[/TD]
[/TR]
[TR]
[TD="align: right"]18/04/2017[/TD]
[TD="align: right"]132952[/TD]
[TD="align: right"]11.96[/TD]
[/TR]
[TR]
[TD="align: right"]24/04/2017[/TD]
[TD="align: right"]132953[/TD]
[TD="align: right"]12.09[/TD]
[/TR]
[TR]
[TD="align: right"]02/05/2017[/TD]
[TD="align: right"]132954[/TD]
[TD="align: right"]12.11[/TD]
[/TR]
[TR]
[TD="align: right"]08/05/2017[/TD]
[TD="align: right"]132955[/TD]
[TD="align: right"]12.07[/TD]
[/TR]
[TR]
[TD="align: right"]15/05/2017[/TD]
[TD="align: right"]132956[/TD]
[TD="align: right"]12.08[/TD]
[/TR]
[TR]
[TD="align: right"]22/05/2017
[/TD]
[TD="align: right"]132957[/TD]
[TD="align: right"]12.08
[/TD]
[/TR]
[TR]
[TD="align: right"]29/05/2017
[/TD]
[TD="align: right"]132958[/TD]
[TD="align: right"]11.98[/TD]
[/TR]
</tbody>[/TABLE]
Should I plough on? My next measure would be to work out the Max, then AVERAGEX MAX- MIN.