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
craigjlane
Frequent Visitor

Taking two conditions and if both are true returning a new value

I have the following table:

 

Shaggy Rogers.png

 

for which I have created two conditional columns which are as follows:

Condition 1 = IF(
    MDD[Test 10] = "True" && MDD[Out] = "True" && MDD[Less than -10] = "True", "YES!", "")
 
Condition 2 = IF(
    MDD[Test 7] = "True" && MDD[In] = "True" && MDD[Less than -10] = "True", "YES!", "")
 
Both are text data types.

I need to get a result of "PATTERN" to return based on "YES!" being in true for Condition 1 and Condition 2.  As you can see, those results are true for Shaggy Rogers, however, I cannot get the return of "PATTERN".  I created the column: 

Con1and2 = IF(MDD[Condition 1] = "YES!" && MDD[Condition 2] = "YES!", "PATTERN", "")

However that doesn't work.  If I change "&&" to "||" it works, but that is only based on one of the two conditions being met.   I need both conditions to be met.  

I'm also curious why the table adds a new row for each name with every new column.  I feel like that might have something to do with the problem as it may not be recognizing that the two conditional results for Shaggy Rogers are the same person.  

I am lost so any help is greatly appreciated.
 
1 REPLY 1
lbendlin
Super User
Super User

 I created the column: 

Con1and2 = IF(MDD[Condition 1] = "YES!" && MDD[Condition 2] = "YES!", "PATTERN", "")

However that doesn't work.

Please be more specific. Did you get an error message, or a wrong result?

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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.