1

I have 3 IF statements, each in a separate column...

Column 1 = IF(RELATED(dim_verification_measure5[measure_check_type])="min",IF([measure_value]<RELATED(dim_verification_measure5[measure_target_value_min]),20,10))
Column 2 = IF(RELATED(dim_verification_measure5[measure_check_type])="max",IF([measure_value]>RELATED(dim_verification_measure5[measure_target_value_min]),20,10))
Column 3 = IF(RELATED(dim_verification_measure5[measure_check_type])="between",IF([measure_value]>RELATED(dim_verification_measure5[measure_target_value_min]),IF([measure_value]<RELATED(dim_verification_measure5[measure_target_value_max]),20,10)))

The resulting value in each column is correct.

enter image description here

However, I would like the see all of the values in the same column. Is it possible to nest all of these IF statements?

1 Answer 1

2

Yes, but instead of nesting if statements which are difficult to read, we use the following:

SWITCH(TRUE(), 
value, result,
value, result,
else)

Alternatively, use COALESCE() on your existing 3 statements.

Sign up to request clarification or add additional context in comments.

4 Comments

Please replace else with result!
What do you mean? That is exactly how it is described in the documentation: learn.microsoft.com/en-us/dax/switch-function-dax
SWITCH(<expression>, <value>, <result>[, <value>, <result>]…[, <else>])
@DavidBacci - I used the COALESCE() method. Much neater than a lengthy nested statement. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.