Forum Discussion
sebasjun
Helper I
8 years agoSUMX with calculate average
Hello I need apply this function I created a simple datatable AVGx = AVERAGE(Table1[x])
Measure Manual = SUMX(Table1; Table1[x] - 14) Measure Calc = SUMX(Ta...
- 8 years ago
Hello sebasjun
Try this - storing the average in a variable. Previously when the [AVGx] measure was computed in the context of each row, context transition meant that it was just averaging the value on that row.
Measure Calc = VAR Avg = [AVGx] RETURN SUMX ( Table1; ( Table1[x] - Avg ) )
- 8 years ago
I think the average has to be either with ALL or ALLSELECTED
AVGx:=CALCULATE(AVERAGE(Table1[x]),ALLSELECTED(Table1[x]))
sebasjun
Helper I
8 years agoStachu
Community Champion
8 years agoI think the average has to be either with ALL or ALLSELECTED
AVGx:=CALCULATE(AVERAGE(Table1[x]),ALLSELECTED(Table1[x]))
- Anonymous8 years agoNot applicable
This measure gets the same results as your manual process
Measure = SUM ( Table1[x] ) - CALCULATE ( [AVGx], ALLSELECTED ( Table1 ) )