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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
zahidah_mabd
Helper I
Helper I

NOT CONTAINS Measure not working

Hi, I want to filter value NOT CONTAINS the specified value but its not working

 

Mismatch Executive = 
CALCULATE( COUNTROWS('table'),
FILTER(
'table',
('table'[Position Assignment Category] = "Permanent ~ Executive" ||
'table'[Position Assignment Category] = "Int. Secondee PET ~ Executive")
&& ('table'[Job Grade] <> BLANK()) &&
( NOT (
CONTAINS ( 'table','table'[Job Grade], "P1" )
|| CONTAINS ( 'table','table'[Job Grade], "P2" )
|| CONTAINS ( 'table','table'[Job Grade], "P3" )

))
)
)+0

can you help me?

1 ACCEPTED SOLUTION

Hi, @zahidah_mabd 

Please try formula as below:

 

Mismatch Executive =
CALCULATE (
    COUNTROWS ( 'table' ),
    FILTER (
        'table',
        ( 'table'[Position Assignment Category] = "Permanent ~ Executive"
            || 'table'[Position Assignment Category] = "Int. Secondee PET ~ Executive" )
            && ( 'table'[Job Grade] <> BLANK () )
            && ( NOT ( 'table'[Job Grade] IN { "P1", "P2", "P3" } ) )
    )
) + 0

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
zahidah_mabd
Helper I
Helper I

Can I use CONTAINS instead of CONTAINSSTRING?

Hi, @zahidah_mabd 

Please try formula as below:

 

Mismatch Executive =
CALCULATE (
    COUNTROWS ( 'table' ),
    FILTER (
        'table',
        ( 'table'[Position Assignment Category] = "Permanent ~ Executive"
            || 'table'[Position Assignment Category] = "Int. Secondee PET ~ Executive" )
            && ( 'table'[Job Grade] <> BLANK () )
            && ( NOT ( 'table'[Job Grade] IN { "P1", "P2", "P3" } ) )
    )
) + 0

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@zahidah_mabd , Try like

 

Mismatch Executive =
CALCULATE( COUNTROWS('table'),
FILTER(
'table',
('table'[Position Assignment Category] = "Permanent ~ Executive" ||
'table'[Position Assignment Category] = "Int. Secondee PET ~ Executive")
&& not(Isblank('table'[Job Grade] )) &&
( NOT (
CONTAINSSTRING ( 'table','table'[Job Grade], "P1" )
|| CONTAINSSTRING ( 'table','table'[Job Grade], "P2" )
|| CONTAINSSTRING ( 'table','table'[Job Grade], "P3" )

))
)
)+0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.