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
Anonymous
Not applicable

Maintenance Revenue to exclude ......

From the code below my goal is to exclude "Grip" and "RH RECURE DATABASE SERVICE" from Maint_Revenue column
 
This is the slice of code that needs to be updated to  exclude Grip and RH RECURE DATABASE SERVICE
I have applied "||" as the logical operator to create an OR condition which may not be right.
What's would be the best way to write this code.
 
"Maint_Revenue", IF(NOT(LEFT(Contract_Items[QT Package],4)="Grip" || "RH RECURE DATABASE SERVICE"), Contract_Items[Price Monthly], 0),

 

 

1 ACCEPTED SOLUTION
dedelman_clng
Community Champion
Community Champion

Hi @Anonymous -

 

Try this

 

Maint_Revenue =
IF (
    NOT ( LEFT ( Contract_Items[QT Package], 4 ) = "Grip" ) &&
      NOT ( Contract_Items[QT Package] = "RH RECURE DATABASE SERVICE" ),
    Contract_Items[Price Monthly],
    0
)

 

Hope this helps

David 

View solution in original post

2 REPLIES 2
dedelman_clng
Community Champion
Community Champion

Hi @Anonymous -

 

Try this

 

Maint_Revenue =
IF (
    NOT ( LEFT ( Contract_Items[QT Package], 4 ) = "Grip" ) &&
      NOT ( Contract_Items[QT Package] = "RH RECURE DATABASE SERVICE" ),
    Contract_Items[Price Monthly],
    0
)

 

Hope this helps

David 

Anonymous
Not applicable

Thanks David.  It was very helpful.

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.

Top Solution Authors