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
admin11
Memorable Member
Memorable Member

How to add NOT in my expression ?

Hi All

Below expression working fine :-

 
_WONnLOSTonly_alq = IF ( 'CRM_TS'[Stage]= Blank(), "No Deal",if (CRM_TS[Stage] in {"7 Order Won","8 Order Lost"},"1","0"))
 
Above expression will return only :-
7 Order Won
8 Order Lost
 
I like to modify the expression , So that it will return not :-
7 Order Won
8 Order Lost
 
I have try :-
_WONnLOSTonly_alq = IF ( 'CRM_TS'[Stage]= Blank(), "No Deal",if (CRM_TS[Stage] NOT in {"7 Order Won","8 Order Lost"},"1","0"))
 
Also try :-
_WONnLOSTonly_alq = IF ( 'CRM_TS'[Stage]= Blank(), "No Deal",if NOT (CRM_TS[Stage] in {"7 Order Won","8 Order Lost"},"1","0"))
 
All above both not working 
 
Paul
1 ACCEPTED SOLUTION
KayceVC
Helper II
Helper II

It sounds like you want your formula to calculate when CRM_TS[Stage] is blank or when it is not 7 or 8. For that, all you should need is:

 

IF ( 'CRM_TS'[Stage]= Blank(), "No Deal",
IF('CRM_TS'[Stage] <> "7 Order Won"  && 'CRM_TS'[Stage] <> "8 Order Lost","1","0"))

 

This is basically telling the 2nd IF that if 'CRM_TS'[Stage] is not equal to 7 AND 'CRM_TS'[Stage] not equal to 8, then 1 else 0. 

 

View solution in original post

2 REPLIES 2
KayceVC
Helper II
Helper II

It sounds like you want your formula to calculate when CRM_TS[Stage] is blank or when it is not 7 or 8. For that, all you should need is:

 

IF ( 'CRM_TS'[Stage]= Blank(), "No Deal",
IF('CRM_TS'[Stage] <> "7 Order Won"  && 'CRM_TS'[Stage] <> "8 Order Lost","1","0"))

 

This is basically telling the 2nd IF that if 'CRM_TS'[Stage] is not equal to 7 AND 'CRM_TS'[Stage] not equal to 8, then 1 else 0. 

 

@KayceVC 

Thank you very much , it work.

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.