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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors