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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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