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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors