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
Syndicate_Admin
Administrator
Administrator

The calculated measure does not add up

Hello everyone!

I need urgent help.

My database is of the grades of a school, for which I must count students who lost each of the subjects for a certain period.

The calculation of the final grade (whether you lose or not) is the average of several grades assigned to the student in the same subject.

Below I show the student's grades in mathematics in year 11. To know if he lost it or not I must get his average and if that average is greater than 2.0 the matter passes, otherwise he loses.

nataliaguzman02_0-1649443259943.png

My problem is that when I add the column (Score_Code) to a table-type visualization, it correctly places the student's average in the subject. As shown in the FinalScore column of the following table.

nataliaguzman02_1-1649443425553.png

But after that I need to know for that subject in that grade how many students lost, so I created a measure that assigns 0 when the student is above or equal to 2 and 1 when he is below, as seen in the image above in the column "Measure", where in that table he assigns it correctly.

But having a general table of the subject with the count of the aspects evaluated (the number of notes taken in the subject), count of students of the course, and the average of grades comes out correctly, but when adding the measure does not make me the sum of the 1, to know how many of them lost.

nataliaguzman02_2-1649443545086.png

Someone can help me please!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Syndicate_Admin 

 

You can try the following methods.

Measure2 =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALL ( 'Table' ),
        [Measure] = 1
            && [Subject] = SELECTEDVALUE ( 'Table'[Subject] )
    )
)

vzhangti_0-1649668398234.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @Syndicate_Admin 

 

You can try the following methods.

Measure2 =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALL ( 'Table' ),
        [Measure] = 1
            && [Subject] = SELECTEDVALUE ( 'Table'[Subject] )
    )
)

vzhangti_0-1649668398234.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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