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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Arranafc19
Helper IV
Helper IV

Dax Filter for equivalent of NOT IN in SQL

Hi

 

I am creating dax measures to count records by id and wondering if it is possible to use a filer similar to not in to exclude a list of ids.

 

 

See below an example of one of the dax measures that works for me where I am counting the number of product ids where the status id is 39.

 

 

Sales = calculate(Count('Status Records' [product_id]) , 'Status Records'[Status_ID] = 39)

 

I need to do similar to the above , however I need to count the number of product ids for all statuses that are not (89,74,32)

 

Anyone able to assist ?

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Arranafc19 , Try like

Sales = calculate(Count('Status Records' [product_id]) , not('Status Records'[Status_ID] in {89,74,32}))
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

View solution in original post

v-diye-msft
Community Support
Community Support

Hi @Arranafc19 

 

I believe below thread could provide you hints:

https://community.powerbi.com/t5/Desktop/DAX-equivalent-of-SQL-s-NOT-IN/m-p/586184 

 

MEASURE NOT IN =
CALCULATE (
    SUM ( Table1[Value] );
    FILTER (
        Table1;
        Table1[Category] = "C"
            && NOT ( Table1[CAT LEVEL] ) IN { 2; 3 }
    )
)
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Arranafc19 

 

I believe below thread could provide you hints:

https://community.powerbi.com/t5/Desktop/DAX-equivalent-of-SQL-s-NOT-IN/m-p/586184 

 

MEASURE NOT IN =
CALCULATE (
    SUM ( Table1[Value] );
    FILTER (
        Table1;
        Table1[Category] = "C"
            && NOT ( Table1[CAT LEVEL] ) IN { 2; 3 }
    )
)
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@Arranafc19 , Try like

Sales = calculate(Count('Status Records' [product_id]) , not('Status Records'[Status_ID] in {89,74,32}))
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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors