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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
Community Champion
Community Champion

@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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.