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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Dax Help

Good Afternoon 

 

I have a combined table in power BI relating to student results in a recent data drop. I have a column of subject names for example English Language, Mathematics etc. i then have a column of grade value which has a value of what was achieved in each subject. I can to a measure that counts the number of results for english above a 4 however I need to do a measure that counts the number of students achieving above a 4 in both english and maths. Can anyone help?

2 REPLIES 2
Markus_Re
Resolver I
Resolver I

Hi, @Anonymous 

 

I hope this will be able to help you:

 

I created a table that looks like this:

Markus_Re_0-1617016453686.png

 

so in this case, as far as i understood,  the count for your case would be 2 (John & Max). 

 

For counting i used this Measure:

 

MathsAndEnglishAbove4 = 

var _filteredTable = FILTER(StudentGrade, (StudentGrade[Subject] = "Mathematics" && StudentGrade[Grade] >= 4) || (StudentGrade[Subject] = "English" && StudentGrade[Grade] >= 4))
var _groupedTable = GROUPBY(_filteredTable, Student[StudentID], "count", COUNTX(CURRENTGROUP(), StudentGrade[StudentID]))
var _result = COUNTX(FILTER(_groupedTable, [count] >= 2), [count])

RETURN

_result
 
Best regards,
Markus
 
Did I answer your question? Mark my post as a solution!
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

If the question is still open, and if it is OK with you, please share your sample PBIX file. Then I can come up with a more accurate measure to solve the problem.

Thank you.

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.