Forum Discussion
If function cannot check inside a column
- 9 years ago
the error is gone but it does not give me the right results (it gives me all zeros!)
i re-tried the if function using measure inside the Classes table but also had to wrap it into a MAX function: and now it works perfectly
Measure = IF ( MAX ( Classes[Class] ) = "A", [Coverage A KPI], IF ( MAX ( Classes[Class] ) = "B", [Coverage B KPI], 0 ) )really appreciate your time and help
Best Regards,
Mohammad
mokhawajai think you have to create a new column not a new measure.
Hi,
i tried the column... and now it says:
"Function 'SWITCH' does not support comparing values of type Text with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values."
- vanessafvg9 years agoCommunity Championtry this ?Value =
SWITCH (true(),
Classes[Class] = "A", [Coverage A KPI],
Classes[Class] = "B", [Coverage B KPI],
Classes[Class] = "C", [Coverage C KPI],0
)- mokhawaja9 years agoFrequent Visitor
the error is gone but it does not give me the right results (it gives me all zeros!)
i re-tried the if function using measure inside the Classes table but also had to wrap it into a MAX function: and now it works perfectly
Measure = IF ( MAX ( Classes[Class] ) = "A", [Coverage A KPI], IF ( MAX ( Classes[Class] ) = "B", [Coverage B KPI], 0 ) )really appreciate your time and help
Best Regards,
Mohammad
- Anonymous9 years agoNot applicable
MAX operates on numbers, not text. For text you could use FIRSTNONBLANK or LASTNONBLANK.