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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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