Forum Discussion
DAX weirdness - nested condition changes behaviour based on output string value
I still am struggling to understand how equivalence in the output values (due to case insensitivity) can cause the nested condition to be evaluated before the condition that contains it. I'm also not sure why this behaviour would be seen when the variables Condition1 and Condition1 are set in the way shown but not when the variables are set by simple assignment of a value.
Regarding evaluation according to row, this behavious only bites on rows where the returned value should be set by the first conditional. All other rows in the table were returned correctly - following the logic in the second conditional.
You can't tell from the results which branch of the condition is being returned, because the text will be converted to the same case as the first row to be evaluated. For an example, create 2 tables like
Tmp 1 = { "Ha", "ha" }
Tmp 2 = { "ha", "Ha" }
Both rows of the tables will show the same values, with the case depending on which was evaluated first.
- al-05433 years agoFrequent Visitor
So why does this issue go away if I assign values to the variables rather than getting them from the two queries? If it was simply to do with the the first row on which the expression is evaluated, shouldn't that then carry through into the simpler situation where the variables are simply assigned?
- johnt753 years agoSuper User
From your original post it seemed that the behaviour only changed when you changed the strings which the condition returned ?