Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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(Table1;(Table1[x] - [AVGx]))
Mesaure Manual is my desired result and Measure Calc is my automated measure
The problem is in Measure Calc this caculate the average per each row and is the same wth x and the result is 0 normal!, i need to calculalte the average total in the context filter (Cliente = C1) --> 14
Thanks
Solved! Go to Solution.
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 ) )
I think the average has to be either with ALL or ALLSELECTED
AVGx:=CALCULATE(AVERAGE(Table1[x]),ALLSELECTED(Table1[x]))
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
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 ) )
I think the average has to be either with ALL or ALLSELECTED
AVGx:=CALCULATE(AVERAGE(Table1[x]),ALLSELECTED(Table1[x]))
This measure gets the same results as your manual process
Measure = SUM ( Table1[x] ) - CALCULATE ( [AVGx], ALLSELECTED ( Table1 ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |