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
ezequiel
Employee
Employee

AND-OR on New Column

Hi

 

I'm trying to add a new column and using the following definition trying to combine OR/AND

 

= Table.AddColumn(#"Added Conditional Column1", "Compliance", each if (([Request Status] = "Pending" or [Request Status] = "Assigned to" or [Request Status] = "Processing" or [Request Status] = "Pending Approval" or [Request Status] = "On Hold" or [Request Status] = "Pending DocuSign" or [Request Status] = "Pending Recipient Information") and [Compliant Request]="NO") then "NO" else "YES")

 

but doesn't seems to work. I have on the column "Request Status" the value the value "Assigned to" and on the column "Compliant Requests" the value "NO" and I'm getting "YES" as result, when the expected result should be "NO".

 

Any clue on this?

 

thanks,

1 ACCEPTED SOLUTION

Hello @ezequiel

 

Not sure about the syntax of your AND / OR

 

The correct syntax is : AND(X;Y) / OR (X;Y) 

 

Maybe try to add a new column and then type in : 

 

Column = IF(AND([Compliant Request]="NO";OR([Request Status] = "Pending";OR([Request Status] = "Assigned to";OR([Request Status] = "Processing";OR([Request Status] = "Pending Approval";OR([Request Status] = "On Hold";OR([Request Status] = "Pending DocuSign";[Request Status] = "Pending Recipient Information")))))));"NO";"YES")

Not sure about the result matching what you are looking for (we need more details to help you)

EDITED 16h24

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

Hi ezequiel ,

 

Please check if there're some unprintable characters in your column. Use trim to remove those character and try again.

 

Regards,

Jimmy Tao

Hi Jimmy...I checked and there are not unprintable chars. Any other suggestion? Do you see any issue on the logic I built?

 

Thanks,

Hello @ezequiel

 

Not sure about the syntax of your AND / OR

 

The correct syntax is : AND(X;Y) / OR (X;Y) 

 

Maybe try to add a new column and then type in : 

 

Column = IF(AND([Compliant Request]="NO";OR([Request Status] = "Pending";OR([Request Status] = "Assigned to";OR([Request Status] = "Processing";OR([Request Status] = "Pending Approval";OR([Request Status] = "On Hold";OR([Request Status] = "Pending DocuSign";[Request Status] = "Pending Recipient Information")))))));"NO";"YES")

Not sure about the result matching what you are looking for (we need more details to help you)

EDITED 16h24

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.