Forum Discussion
Measure won't sum up
- 6 years ago
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])Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
how does look like your measure now?
- veranceftw6 years agoHelper II
Like this:
Pressure Final 3rd p90 = SUM(all_match_stats[pressures_att_3rd]) / (SUM(all_match_stats[minutes]) / 90.0)- az386 years agoCommunity Champion
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
- veranceftw6 years agoHelper II
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
- Icey6 years agoCommunity Support
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.
- veranceftw6 years agoHelper II
That measure is returning NaN for me