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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
veranceftw
Helper II
Helper II

Measure won't sum up

Hello!

 

I have a measure that calculates the sum of a stat for every player. However, when I group those players as a team, instead of summig up all the measures for each player, it seems to be returning the average. How do I make it a sum?

 

Kind regards

 

 

 

veranceftw_0-1596285306186.png

 

1 ACCEPTED SOLUTION

Hi @veranceftw ,

 

Sorry to reply late. 

Please try to create a measure like so:

Measure 2 = SUMX(VALUES(all_match_stats[player_name]),[Pressure Final 3rd p90])

sum.PNG

 

Best Regards,

Icey

 

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

10 REPLIES 10
VijayP
Super User
Super User

@veranceftw  What is the measure for 3.99 value , I think problem should be there




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


az38
Community Champion
Community Champion

@veranceftw 

how does look like your measure now?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Like this:

 

Pressure Final 3rd p90 = SUM(all_match_stats[pressures_att_3rd]) / (SUM(all_match_stats[minutes]) / 90.0)

Hi @veranceftw ,

 

For the value in the second table, it first calculates the sum of each teams of the two columns separately, and then divides the two sums. For example, the value 3.99 is calculated like so: 

 

Pressure Final 3rd p90 Manchester City =
CALCULATE (
    SUM ( all_match_stats[pressures_att_3rd] ),
    all_match_stats[team_name] = "Manchester City"
)
    / (
        CALCULATE (
            SUM ( all_match_stats[minutes] ),
            all_match_stats[team_name] = "Manchester City"
        ) / 90.0
    )

 

 

It is suggested to create another measure to get sum value:

 

Measure = SUMX('all_match_stats',[Pressure Final 3rd p90])

 

 

I create a simple example, please check the attached .pbix file.

 

 

Best Regards,

Icey

 

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

That measure is returning NaN for me 

Hi @veranceftw ,

 

If the measure I provided doesn't work, please share me your .pbix file to help you better. Please remove sensitive information and unnecessary visuals. It is suggested to upload your file to OneDrive for Business and then paste the link here.

 

 

Best Regards,

Icey

@Icey , thanks for your help, much appreciated 🙂

 

Here is the pbix file! Thank you

 

Kind regards,

 

Luís

Hi @veranceftw ,

 

Sorry to reply late. 

Please try to create a measure like so:

Measure 2 = SUMX(VALUES(all_match_stats[player_name]),[Pressure Final 3rd p90])

sum.PNG

 

Best Regards,

Icey

 

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

az38
Community Champion
Community Champion

@veranceftw 

maybe you need smth with SUMX()

Pressure Final 3rd p90 = 
SUMX(all_match_stats,
SUM(all_match_stats[pressures_att_3rd]) / (SUM(all_match_stats[minutes]) / 90.0)
)

but more correct and appropriate answer is possible if you provide more detail about your data model


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

That did not work, @az38 

 

Well my model is very simple.

 

I have a dataset where each row corresponds to a match. Every match has the player_ref, team_ref and the stat. 

Since a group of players share the same team, I am using the team_ref as a proxy to group the players. However, when I do that like the image I posted it returns the average instead of the sum of all the players.

 

Thank you,

 

Luís

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.