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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
StanleyBlack
Helper I
Helper I

COUNTIF an aggregated Measure is below a threshold

Hi Everyone,

 

Apologies if this is actually really easy but whilst I know what I need to do, finding the DAX solution is proving tricky.

 

The scenario is I have numerous aggregated school attendance measures that give me an overall attendance figure that I can filter by various factors such as year group, gender, school etc. What I would like to do is take this calculation, calculate it inside a measure for all students row by row and return the number of students that are within certain bands; initially with students that are below 90% attendance.

 

Persistent Absence Example.png

As seen above, I can get this number by putting the measure in a table alongside the student name field or in this case a discreet identifier and applying a filter in the visual filters section. What I really want is a measure that returns just "31" so that I can then use that measure alongside time intelligence functions to track changes over time. I think this may involve utilising the COUNTIF function but I don't know the way to disaggregate the attendance measure to student level inside a measure prior to applying that. I would use a calculated column to provide the total attendance but I don't think that is the best way forward.

 

As a side note the attendance measure is drawn from an attendance table and takes the sum present sessions and then divides that by the sum possible sessions. Any suggestions would be appreciated.

 

Thanks in advance.

1 ACCEPTED SOLUTION
cadalano
Frequent Visitor

This sounds similar to a problem I posted about today - the same solution I was given might work for you:

 

 

https://community.powerbi.com/t5/Desktop/DAX-Challenge-Count-of-Unique-ID-s-where-their-Sum-of-anoth...

 

 

View solution in original post

2 REPLIES 2
cadalano
Frequent Visitor

This sounds similar to a problem I posted about today - the same solution I was given might work for you:

 

 

https://community.powerbi.com/t5/Desktop/DAX-Challenge-Count-of-Unique-ID-s-where-their-Sum-of-anoth...

 

 

Thanks cadalano that sorted it. As I thought it was as simple a soloution as a thought it would be but I wouldn't have figured it out without your help.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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