Forum Discussion
Weekly Totals per player
Hi all,
I have to do something quite simple, but cannot find the right way to do it. My data base contains football GPS Data, with a row corresponding for a date, a player, and activity, and thousands of metrics.
I added a Week column and would like to have a weekly average for each player, and do further calculations with these values (for example the average of all the totals for a given week).
I tried different things:
1) Doing the average of the whole team directly in a visual, for each week, but it comes out as the average of each day instead of the average of the week total.
2) Created a calculated column with weekly totals. The problem with that is that the weekly total is shown on each row of my table, so the average between all players depends on how many rows the player got that week. This is the formula I used:
2 Replies
- Sahir_MaharajSuper User
Hello ThomasRichard21,
Can you please try the following approach:
1. Calculate the weekly total distance for each player
WeeklyTotalDistance = CALCULATE( SUM(ARaw[Total Distance]), FILTER( ARaw, ARaw[Nom] = MAX(ARaw[Nom]) && ARaw[Semaine] = MAX(ARaw[Semaine]) && (ARaw[Period Name] = "Terrain" || ARaw[Period Name] = "Match" || ARaw[Period Name] = "Reha" || ARaw[Period Name] = "Modifié" || ARaw[Period Name] = "Récup") ) )2. Calculate the average weekly total distance per player
WeeklyAverageDistance = CALCULATE( AVERAGEX( VALUES(ARaw[Semaine]), [WeeklyTotalDistance] ) )3. Calculate the average of all players' weekly totals for a given week
OverallWeeklyAverage = CALCULATE( AVERAGEX( SUMMARIZE( ARaw, ARaw[Nom], ARaw[Semaine], "WeeklyTotalDistance", [WeeklyTotalDistance] ), [WeeklyTotalDistance] ), ALLSELECTED(ARaw[Semaine]) )You should also have a relationship between your player names and week numbers in both tables.
Hope this helps!
- ThomasRichard21Frequent Visitor
Hi Sahir_Maharaj ,
Thanks a lot for the fast answer.
Should they all be "New Measures"?
Regarding your 2nd Measure "WeeklyAverageDistance", I am not sure I understand what I would measure with that, but I did it and it seems to give me the same thing than the first one. also where do you use it in your 3rd suggested measure?
Regarding the last one OverallWeeklyAverage, it doesn't seem to give me the right result.
Also I don't understand from which tables I should match the players and week numbers? Should I create a new table at some point?
Thanks a lot again
Thomas