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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
nick9one1
Helper III
Helper III

Total isn't being calculated correctly

nick9one1_0-1667846989348.png


I have this Matrix, built from two tables. 

Category table

nick9one1_1-1667847142906.png

 

related one to many to this table 

 

nick9one1_2-1667847221617.png

 

 

I need to calculate a score for each category. 

Performance score = ((Points Available - Demerits)/Points Available)*Weighting

I've created measure to calculate this, and each row is correct. But the total is wrong. 

 

 

Demerits = SUM(Submissions[Demerits])

 

 

Points Achieved = SUM('Categories'[cr20b_pointsavailable])-[Demerits]
Weighting = SUM(Categories[cr20b_weighting])
Performance Score = (([Points Achieved]/[Points Available]*[Weighting])/[Weighting])

 

 

 

 





1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @nick9one1 ,

Measures are calculated by context, in other words, measure is calculated based on the value of current row.

From your snapshot can see, the result of total is correct in calculation: (145/163*20)/20=88.96%

vkalyjmsft_0-1667876276144.png

If you want the total is sum of all rows, try the solution:

Measure =
VAR _T =
    ADDCOLUMNS ( 'Categories', "Column", [Performance Score] )
RETURN
    IF (
        HASONEVALUE ( [Category Ordered] ),
        [Performance Score],
        SUMX ( _T, [Column] )
    )

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @nick9one1 ,

Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!

 

Best Regards,
Community Support Team _ kalyj

v-yanjiang-msft
Community Support
Community Support

Hi @nick9one1 ,

Measures are calculated by context, in other words, measure is calculated based on the value of current row.

From your snapshot can see, the result of total is correct in calculation: (145/163*20)/20=88.96%

vkalyjmsft_0-1667876276144.png

If you want the total is sum of all rows, try the solution:

Measure =
VAR _T =
    ADDCOLUMNS ( 'Categories', "Column", [Performance Score] )
RETURN
    IF (
        HASONEVALUE ( [Category Ordered] ),
        [Performance Score],
        SUMX ( _T, [Column] )
    )

Best Regards,
Community Support Team _ kalyj

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

PabloDeheza
Solution Sage
Solution Sage

Hi @nick9one1 !
Please refer to this videos, explaining the behaviour of totals in Power BI:
Why Power BI totals might seem wrong 
Let me know if that helps!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors