Forum Discussion
simonfalun
9 years agoFrequent Visitor
Calculating an average by person
I've been searching over and over, but I can't find the solution - so I'm afraid that there isn't any solution to this. I have a table ("Time reports") with all reporting for our employes, grouped...
- 9 years ago
Assuming you only have the 'Person' on rows, then while i have not tested it this should work:
Avg per Person last 10 reported days =
CALCULATE ( AVERAGE ( 'Time Reports'[Billed Hours] ); TOPN ( 10, VALUES ( 'Time Reports'[Date] ); LASTDATE ( 'Time Reports'[Date] ) ) )
mattbrice
Solution Sage
9 years agoAssuming you only have the 'Person' on rows, then while i have not tested it this should work:
Avg per Person last 10 reported days =
CALCULATE ( AVERAGE ( 'Time Reports'[Billed Hours] ); TOPN ( 10, VALUES ( 'Time Reports'[Date] ); LASTDATE ( 'Time Reports'[Date] ) ) )
- v-ljerr-msft9 years ago
Microsoft Employee
Hi simonfalun,
I just verified that the formula provided by mattbrice above should work in your scenario. :smileyhappy:
mattbrice, nice solution! Kudos +1. :smileywink:
Regards
- simonfalun9 years agoFrequent Visitor
AWESOME! Thank you - you just turned my **bleep**ty day into a really great day!! :smileyvery-happy:
I created a new table with only the persons and added a calculaded column with your code - worked like a charm!
Next step for me is to analyze the code so I can understand how it works :smileyhappy:
Have a great day everyone!