Forum Discussion
Incorrect SUMX total (again)
- Anonymous2 years ago
Hi Anonymous ,
Please refer to Solved: Measure Total Incorrect - Microsoft Fabric Community .
Solved: Wrong Totals with SUMX Measure - Microsoft Fabric Community
Solved: Wrong totals on SUMX column - Microsoft Fabric Community
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Would be good to see a sample of the dataset alongside what it's outputting to get a better idea of it, the most likely fix would be to wrap your function in a calculate, I don't remember exactly why this works, but it's somthing about passing filter context to your measure. So you would replace the expression argument in your SUMX with the below:
CALCULATE(( [PU_Comp2] - [PU_Comp1] ) * [Qty_Comp2])
Anonymous wrote:
I don't remember exactly why this works, but it's somthing about passing filter context to your measure.
CALCULATE(( [PU_Comp2] - [PU_Comp1] ) * [Qty_Comp2])
Yes that's correct! By wrapping up the calculations in their own measures you prevent passing unwanted/ unexpected filter context into the SUMX calculation. So this should work.