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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.