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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BostonBI
Frequent Visitor

how to return the amount of where the sum of values for each student is 0?

Heres the situation, according to my dataset(made one fast on Excel to speed things up) i need to retrieve the amount of students which the sum of values is equal to 0:

Heres the dataset: 
abc.png










Ive tried to create this measure :

Measure = CALCULATE(DISTINCTCOUNT(Table1[ID_Student]), FILTER((Table1, SUM((Table1[Value])=0))+0

But it always returning 0 instead of the expect result which is 2.


2 ACCEPTED SOLUTIONS
andhiii079845
Solution Sage
Solution Sage

Okay, thank you. Try this:

 
Measure = 
VAR __table = SUMMARIZE('Table','Table'[Student],"__sum0",SUM('Table'[Value]))
RETURN COUNTX(FILTER(__table,[__sum0]=0),[Student])




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

Proud to be a Super User!




View solution in original post

tamerj1
Super User
Super User

Hi @BostonBI 

please try

Measure1 =
SUMX (
VALUES ( Table1[ID_Student] ),
INT ( CALCULATE ( SUM ( Table1[Value] ) ) = 0 )
)

View solution in original post

5 REPLIES 5
tamerj1
Super User
Super User

Hi @BostonBI 

please try

Measure1 =
SUMX (
VALUES ( Table1[ID_Student] ),
INT ( CALCULATE ( SUM ( Table1[Value] ) ) = 0 )
)

andhiii079845
Solution Sage
Solution Sage

Okay, thank you. Try this:

 
Measure = 
VAR __table = SUMMARIZE('Table','Table'[Student],"__sum0",SUM('Table'[Value]))
RETURN COUNTX(FILTER(__table,[__sum0]=0),[Student])




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

Proud to be a Super User!




You got that Right,Thank you Alot!

andhiii079845
Solution Sage
Solution Sage

Hi,

my solution:

Measure = 

VAR __table =SUMMARIZE(FILTER('Table','Table'[Value]=0),'Table'[Student],"__count0",count('Table'[Subject]))
RETURN sumx(__table,[__count0])
 
andhiii079845_0-1677590588532.png
You write: 
But it always returning 0 instead of the expect result which is 2. -> why 2 i count 3 students in your example? 




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

Proud to be a Super User!




Theres actually 4 students on my example, Which 2 of them got only 0 In theis values. Summarizing:

I need to return the amount of students which all values Science,Math and English are 0.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.