Forum Discussion
sebasjun
8 years agoHelper I
SUMX 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]))
v-yuta-msft
8 years agoCommunity Support
Hi sebasjun,
Change measure [AVGx] to a calculate column [AVGx Column] them modify [Measure Calc] using DAX like this:
Measure Calc = VAR XXX = MAX(Table1[AVGx Column]) RETURN SUMX ( Table1, ( Table1[x] - XXX ) )
The result is as below:
Regards,
Jimmy Tao