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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
BrendenS
Frequent Visitor

Multiple Field Filter in Single Column DAX Measure

Hello Forum - Hoping someone can give me quick help on this dax measure.  I am trying to calculate all open defects (So status not equal to Closed, Rejected, or Duplicate).  This is just count of Defect query status column with a status column filter.  The correct number is 91 yet with the below formula I keep getting the full defect count of 444.  What am I doing incorrectly in this measure?  No filters are set on my scorecard visual.

 

BrendenS_0-1723240636237.png

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @BrendenS 

It looks like you need "and" rather than "or", since you want to exclude each of those Status values. So one fix would be to change || to && within the FILTER condition.

 

I would also recommend rewriting to filter the Status column (using KEEPFILTERS) rather than the Defects table, and use IN for conciseness.

Open Status Defect No Rejected or Duplicate =
CALCULATE (
    COUNT ( Defects[ Status] ) + 0,
    KEEPFILTERS ( NOT Defects[ Status] IN { "Closed", "Rejected", "Duplicate" } )
)

Some references here:

https://learn.microsoft.com/en-us/dax/best-practices/dax-avoid-avoid-filter-as-filter-argument

https://xxlbi.com/blog/power-bi-antipatterns-9/

 

Does the above help?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @BrendenS 

It looks like you need "and" rather than "or", since you want to exclude each of those Status values. So one fix would be to change || to && within the FILTER condition.

 

I would also recommend rewriting to filter the Status column (using KEEPFILTERS) rather than the Defects table, and use IN for conciseness.

Open Status Defect No Rejected or Duplicate =
CALCULATE (
    COUNT ( Defects[ Status] ) + 0,
    KEEPFILTERS ( NOT Defects[ Status] IN { "Closed", "Rejected", "Duplicate" } )
)

Some references here:

https://learn.microsoft.com/en-us/dax/best-practices/dax-avoid-avoid-filter-as-filter-argument

https://xxlbi.com/blog/power-bi-antipatterns-9/

 

Does the above help?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Exactly what I needed.  Thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.