Forum Discussion
gjensen
3 years agoFrequent Visitor
Very Slow Measure
I'm needing to write a measure that brings back the total value of customers who didn't drop a specific service. I have a measure that does this but it's so slow that it won't be accepted by end user...
YukiK
3 years agoImpactful Individual
I'd use SWITCH than nested IF statement. That might not have direct impact on performance but readability is clearer.
Another thing that caught my attention is this:
VAR vResult =
CALCULATE (SUMX(Charges,[Total Charges] ), vActiveCustomers )
I think you can just do this:
VAR vResult =
SUMX(vActiveCustomers,[Total Charges] )Or this:
VAR vResult =
CALCULATE([Total Charges], vActiveCustomers )
Also, you can use field parameters for stopped customers