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

Struggling with an IF rule

Hi All 

 

I cannot get this to work, I feel like it should be easier then I am making it!

 

What I need to occur is: 

 

If non compliant> 1 and comments >1 Yes

If non compliant>1 and comments <1 No

If non compliant <1 N/A

 

https://1drv.ms/x/s!ArM9L8ohYGT4gQhszs0ssIc8haUT

 

Thank you!!

 

PowerBICurious

1 ACCEPTED SOLUTION

Hi @PowerBI-Curious,

 

After looking into your shared sample data, I found the data type of  "Comments" column is Text type(with numbers and the actual comments).

 

Based on my test, the formula below should work in your scenario. Smiley Happy

 

Column = 
IF (
    'CCC Verification List Report'[Non-Compliant] >= 1,
    IF (
        VALUE ( LEFT ( 'CCC Verification List Report'[Comments], 1 ) ) >= 1,
        "Yes",
        "No"
    ),
    "N/A"
)

 

Regards

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

You have the best username ever, so... let's fix you up! 🙂

 

Are you trying to make a new calculated column based on those rules?

What do you want to happen if non-complaint = 1 ?

Hi @Anonymous thanks for your quick response - I was hoping the name might help me out Smiley Wink

 

Yes I want a new calculated column based on those rules (unless there is a better option)

 

So if non-compliant = 1 that is when I want it to say yes or no to there being comments.

If there are no non-compliance there is no need for comments so that should be a straight N/A.

 

Does that make sense?

Hi @PowerBI-Curious,

 

After looking into your shared sample data, I found the data type of  "Comments" column is Text type(with numbers and the actual comments).

 

Based on my test, the formula below should work in your scenario. Smiley Happy

 

Column = 
IF (
    'CCC Verification List Report'[Non-Compliant] >= 1,
    IF (
        VALUE ( LEFT ( 'CCC Verification List Report'[Comments], 1 ) ) >= 1,
        "Yes",
        "No"
    ),
    "N/A"
)

 

Regards

Thank you, this worked perfectly 🙂

Anonymous
Not applicable

So actually (adjustments in red):

If non compliant>=1 and comments >=1 Yes

If non compliant>=1 and comments <=1 No

If non compliant <1 N/A

 

Something like:

 

NewColumn = IF (MyTable[NonCompliant] >= 1,
    IF (MyTable[Comments] >= 1, "Yes", "No"),
    "N/A"
)

 

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.