Forum Discussion
Measure with multiple conditions
- 5 years ago
You are missing "(" after SWITCH. Also, I would first store your two measures as variables and then use the variables in the SWITCH evaluations. The way it is written will cause a lot of recalculation. Partial example below (note that you should not include the table name when referencing measures so other knows it is a measure and not a column reference).
Measure =
VAR varpy3M = [TM3MR%VARPY]
VAR varpy12M = [TM12MR%VARPY]
RETURN
SWITCH (
TRUE (),
varpy3M > 0
&& varpy12M < 0, "RECOVERY",
varpy3M >= 0.02
&& TM[TM12MR%VARPY] >= 0.02, "EXPANSION",
"Other"
)Regards,
Pat
It's hard to tell based on this information. The most likely issue is that you have to get the order of these correct. Switch will stop on the first result that returns true. If you can't work out what is happening I suggest you write each component as a simpnle measure and see what they return.