Forum Discussion
ezequiel
7 years agoMicrosoft Employee
Average hours per week
Hi I'm trying to show the average hours per week per employee. The table contains Employee Name, hours, Project Name and week_number. One employee can have multiple projects in one week. I tr...
- 7 years ago
Hi,
Drag Employee Name and Start of week to the Table visual and write this measure
=AVERAGE(Tracker[Hours])
Hope this helps.
ezequiel
7 years agoMicrosoft Employee
Hi MFelix
As example an employee has this data
| EmployeeName | Hours | Start of Week | WeekNum |
| John | 7 | 7/29/2019 | 1 |
| John | 7 | 7/29/2019 | 1 |
| John | 7 | 8/5/2019 | 2 |
| John | 7 | 8/5/2019 | 2 |
| John | 21 | 8/5/2019 | 2 |
| John | 2 | 8/12/2019 | 3 |
| John | 5 | 8/12/2019 | 3 |
| John | 4 | 8/12/2019 | 3 |
| John | 2 | 8/12/2019 | 3 |
| John | 8 | 8/12/2019 | 3 |
| John | 9 | 8/12/2019 | 3 |
| John | 2 | 8/12/2019 | 3 |
| John | 8 | 8/12/2019 | 3 |
Using the formula Avg_hours = CALCULATE(AVERAGE(Tracker[Hours]), ALLEXCEPT(Tracker, Tracker[EmployeeName], Tracker[WeekNum]))
The result I'm getting is 6.79 for the week of 7/29, 8/5, 8/12. The expected result would be
Week of 7/29: 7 hours
Week of 8/5: 11.67 hours
Week of 8/12: 5 hours
Thanks for the help
Ezequiel
Ashish_Mathur
7 years agoSuper User
Hi,
Drag Employee Name and Start of week to the Table visual and write this measure
=AVERAGE(Tracker[Hours])
Hope this helps.