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])
Thanks Anonymous , I tried that but did not work (no changes).
What worked instead is to embed my calculation in another SUMX:
∆Price2 = SUMX (VALUES(Fact_Sales[Key]), [∆Price])
where Fact_Sales[Key] is the concatenation of Cli_ID and Prod_ID.
As said this works but looks very inefficient running SUMX twice on a pretty large Fact Table. Any guess?