Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi I am trying to calculate the moving range to make an SPC chart using a measure. However with my calculation I am currently using the moving range includes the first value which I never want to include.
What I want to know is how do I ingore that value when calculating the moving range.
Moving Range =
VAR EarlierTime =
CALCULATE (
MAX ( 'Data sheet'[Date] ),
FILTER (
ALLSELECTED('Data sheet'[Date]),
'Data sheet'[Date] < SELECTEDVALUE ( 'Data sheet'[Date])
)
)
VAR EarlierMeasureValue =
CALCULATE ( SUM ( 'Data sheet'[Value] ), 'Data sheet'[Date] = EarlierTime)
RETURN
ABS ( EarlierMeasureValue - SUM ( 'Data sheet'[Value] ))
Hi @JamesHR ,
You can create a ranking column for your values and then filter out the first value you don't want in your original measure formula.
Power BI RANKX | How to Use RANKX Function
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.