Forum Discussion

Malva's avatar
Malva
Regular Visitor
4 years ago
Solved

Power Query - Else if not returning desired result

Hello,

 

I need to create a conditional column based on values of two different columns, "Access Matches" and "Locked temporarily".

This is the code I have at the moment:

 

"

if [Access Matches] = "Yes" then "Yes"

else if [Access Matches] = "No" then "No"

else if [Access Matches] = null and [Locked temporarily] = null then "No - never logged in"

else if [Access Matches] = null and [Locked temporarily] = "FALSE" then "Yes"

else if [Access Matches] = null and [Locked temporarily] = "TRUE" then "No"

else "Check - error"

"

The code is working as expect for the first 3 lines, but for the 4th and 5th ones (highlighted), it is not retrieving the correct result, when on my data set I do have such combinations available. As a result, it is returning instead the "else" result, "Check - error".

 

 

I don't understand what is wrong with my code, can you please help identifying the reason? I tried multiple options but none seems to work.

 

Thank you

1 Reply

  • Hi Malva ,

    Try with true and false instead of "TRUE" and "FALSE".