Forum Discussion
PVO3
4 years agoImpactful Individual
Multiple contexts within iterator
Hello all, I would like some help with a measure. See the screenshot below. I would like that the result of Measure2 would be 143 for every row. In VAR _Result I already have the result and the...
v-henryk-mstf
4 years agoCommunity Support
Hi PVO3 ,
Try the measure as below:
Measure2 =
VAR _MaxR =
CALCULATE (
MAXX ( VALUES ( 'Date'[YearMonth] ), [Measure1] ),
REMOVEFILTERS ()
)
VAR _Avg =
DIVIDE (
CALCULATE (
SUMX ( VALUES ( 'Date'[YearMonth] ), [Measure1] ),
REMOVEFILTERS ()
),
_MaxR
)
VAR _Result = ( [Measure1] - _Avg ) ^ 2
VAR a =
IF ( [Measure1] < 1, BLANK (), _Result )
RETURN
SUMX (
FILTER ( ALLEXCEPT ( 'Date', 'Date'[Date], 'Date'[MonthNumber] ), _Result ),
a
)
If the problem is still not resolved, please point it out. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PVO3
4 years agoImpactful Individual
Thanks a lot for your effort v-henryk-mstf
Unfortunatly it didnt give the expected result. Tried it in the example file and if gave the result below.
Or perhapse I'm missing something?