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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Count with Conditions & Filter

I am trying to count the number of Records whose status reason is either accepted, rejected or cancelled and I am not getting the right number using this measure

 

Total Resolved = CALCULATE(DISTINCTCOUNT('table'[ID]), FILTER('table', table[Status Reason]<>"Accepted" && table[Status Reason]<>"Rejected" && table[Status Reason]<>"Cancelled"))
 
your help is most appreciated

 

IDStatus ReasonState
DRQ-001AcceptedActive
DRQ-002ReviewingActive
DRQ-003Awaiting ReviewActive
DRQ-004RejectedInactive
DRQ-005CancelledInactive
DRQ-006AcceptedActive
DRQ-007ReviewingActive
DRQ-008Awaiting ReviewActive
DRQ-009RejectedInactive
DRQ-010CancelledInactive
DRQ-011AcceptedInactive
DRQ-012ReviewingActive
DRQ-013Awaiting ReviewActive
DRQ-014RejectedActive
DRQ-015CancelledInactive
DRQ-016AcceptedInactive
1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

It is little confusing, your post says as "... status reason is either accepted..." and your DAX syntax uses <>. Taking your DAX and providing below. If you are looking for one of these status reasons, then remove the word "not".

 

Total Resolved = CALCULATE(DISTINCTCOUNT('Table'[ID]), FILTER('Table', not 'Table'[Status Reason] in { "Accepted", "Rejected", "Cancelled"}))

 

Output:

 

sevenhills_0-1697046864388.png

 

View solution in original post

1 REPLY 1
sevenhills
Super User
Super User

It is little confusing, your post says as "... status reason is either accepted..." and your DAX syntax uses <>. Taking your DAX and providing below. If you are looking for one of these status reasons, then remove the word "not".

 

Total Resolved = CALCULATE(DISTINCTCOUNT('Table'[ID]), FILTER('Table', not 'Table'[Status Reason] in { "Accepted", "Rejected", "Cancelled"}))

 

Output:

 

sevenhills_0-1697046864388.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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