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
Clint
Helper V
Helper V

Understanding results returned by CountAX function

Hello,

 

I have a table that has records with various status values.  Ideally, I'd like to count all records except for those in certain statuses but I have not been able to figure out the dax to make that work.  As an alternative, I built a measure to count only those records in the statuses I want to remove from the total so I can subtract this value from the overall count.  
I am using the following to count the records w/the statuses I will later subtract:

M_Inactive Items = COUNTAX('Boydenhancements','Boydenhancements'[Status] iN {"Removed","N/A","Completed","Not Approved"}
)
The problem is, this measure should return a number of 48 but instead, it returns the total count of all records which is 232.  Not sure why it is ignoring the IN part of the expression but would appreciate some insight as to where I"m going wrong here...
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Clint try the following measure,

COUNTAX (
FILTER (
'Boydenhancements',
'Boydenhancements'[Status] IN { "Removed", "N/A", "Completed", "Not Approved" }
),
'Boydenhancements'[Status]
)

Regards,
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @Clint try the following measure,

COUNTAX (
FILTER (
'Boydenhancements',
'Boydenhancements'[Status] IN { "Removed", "N/A", "Completed", "Not Approved" }
),
'Boydenhancements'[Status]
)

Regards,
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you @MFelix , this worked perfectly.

vanessafvg
Super User
Super User

@Clint  are you able to share some of the data?

 

 




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hi Vanessa - MFelix was able to show me the correct syntax.  Thank you for the response.

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.