Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Malva
Regular Visitor

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".

 

Malva_1-1652344250193.png

 

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 ACCEPTED SOLUTION
Payeras_BI
Solution Sage
Solution Sage

Hi @Malva ,

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

Payeras_BI_0-1652346483925.png

 

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

1 REPLY 1
Payeras_BI
Solution Sage
Solution Sage

Hi @Malva ,

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

Payeras_BI_0-1652346483925.png

 

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.