Forum Discussion
Use measure in calculated row for multiple rows
- 5 years ago
hope this helps.
When performing the STD calculation you need to tell CALCULATE which context you want to consider.
The context you described is all rows where the last seven days flag is one.
It can be a bit of a mind bender, but as grasped is amazingly powerful.
=var _STD=CALCULATE(STDEV.P(Table1[Value]), filter(ALL(Table1),[InLast7Days]=1) ) return if(Table1[AbsValue]>_STD && Table1[InLast7Days]=1, 1,0)
hope this helps.
When performing the STD calculation you need to tell CALCULATE which context you want to consider.
The context you described is all rows where the last seven days flag is one.
It can be a bit of a mind bender, but as grasped is amazingly powerful.
=var _STD=CALCULATE(STDEV.P(Table1[Value]),
filter(ALL(Table1),[InLast7Days]=1)
)
return if(Table1[AbsValue]>_STD &&
Table1[InLast7Days]=1,
1,0)
This works so well, thank you so much!
If i would like to add an additional filter to the _STD calculation, like an EstimateType which could be 1, 2 or 3, could I just add it like this?
=var _STD=CALCULATE(STDEV.P(Table1[Value]),
filter(ALL(Table1),[InLast7Days]=1)
, [EstimateType] = 2)
Or would I have to add it in a different way?