Forum Discussion
PC2022
1 year agoHelper III
CONTAINS formula or something else?
I need to calculate sum score based on criteria that all 5 review phases evaluations are present for the project ID. For example, for the project below, the score shouldn't get calculated, as only 2 phases have been completed.
EvalJobComp = CALCULATE(SUMX(crb87_consultantevaluation,
([EvalDesignComp30] * 0.7) + ([EvalConstrComp] * 0.3)),
CONTAINS(crb87_consultantevaluation, crb87_consultantevaluation[Review Phase], "30% Design") ||
CONTAINS(crb87_consultantevaluation, crb87_consultantevaluation[Review Phase], "60% Design") ||
CONTAINS(crb87_consultantevaluation, crb87_consultantevaluation[Review Phase], "100% Design") ||
CONTAINS(crb87_consultantevaluation, crb87_consultantevaluation[Review Phase], "Mid-Construction") ||
CONTAINS(crb87_consultantevaluation, crb87_consultantevaluation[Review Phase], "Construction/Final"))
I get an error: a function "contains" has been used in a true/false expression that is used as a table filter expression.
Use CONTAINSSTRING instead.
9 Replies
- lbendlinSuper User
Use CONTAINSSTRING instead.
- PC2022Helper III
Used Containsstring. Doesn't give error anymore but not returning any results although i know there are projects where all phases evals exist.
EvalJobComp = CALCULATE(SUMX(crb87_consultantevaluation,([EvalDesignComp30] * 0.7) + ([EvalConstrComp] * 0.3)),CONTAINSSTRING(crb87_consultantevaluation[Review Phase], "30% Design") &&CONTAINSSTRING(crb87_consultantevaluation[Review Phase], "60% Design") &&CONTAINSSTRING( crb87_consultantevaluation[Review Phase], "100% Design") &&CONTAINSSTRING( crb87_consultantevaluation[Review Phase], "Mid-Construction") &&CONTAINSSTRING( crb87_consultantevaluation[Review Phase], "Construction/Final"))