Forum Discussion
johnsmith92
5 years agoRegular Visitor
Rewrite SUMX? Poor performance when running calculations
Hi all, I have the following table: Queue AgentName Year Quarter Month Score1 Weight1 1 John 2021 1 January 100 6.87 1 John 2021 2 June 66,67 5.357 1 John 20...
johnsmith92
5 years agoRegular Visitor
Thanks for the follow up, but if I'm not mistaken, what you suggest would end up evaluating the
CALCULATE ( SUM ( FactScore[Score1] ) ) / CALCULATE ( COUNT ( FactScore[Score1] ) ) statement first
and this is my backup statement in case I have 0s in the weight column. But your suggestion of removing IFERROR has done wonders to my query. Now I just need to figure out the conditional calculation.
v-kelly-msft
Community Support
5 years agoHi johnsmith92 ,
You could use
CALCULATE(FactScore[Score1] * FactScore[Weight1];FactScore)
instead of
SUMX ( FactScore; FactScore[Score1] * FactScore[Weight1] )
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!