Forum Discussion
Problem calculation total work hours
I need to calculate the total work time per employee for a given period (ie month).
Our employees have a normal work time calender with a daily work time ie 7.5 hours monday to thursday and 7 hours friday totalling 37 hours per week. Some employees work parttime and have a differenct worktime calender ie. 6 hours a day totalling 30 hours per week. And some again have diffent worktimes per day/week.
A date table holds the daily work time per given worktime-calender:
Dato = Date
Timer = The total work hours that date
Kalendernr = The number for the special work-calender (ie Kalendernr "0" that has 7.5 hours per day exept friday thats 7 hours., Kalendernr "85" has 5 hours per day - not shown above, Kalendernr xx has other work hours etc.),
The Calendertable is joined with the employee-table:
Medarb nr. = the employee number
Kalendernr the joined field with the Calender-table
I have af period-slicer joined with the date table controlling the date interval and it works.
The problem is that the calculated value i get in the field "Timer" in the date table is only for one person - because the date table (workcalender) only hold the data once. I somehow have to multiply that with the number of employees with that given Work-calender - or ?.
Any ideas...
12 Replies
- Greg_DecklerCommunity Champion
I can't get to the answer for this with the information provided, can you supply some of your raw data or a sample of mocked up data? It sort of sounds like you are doing a join in M and perhaps you need to import them as separate tables and relate them properly in order to get the effect that you want.
- HenrikH29Advocate I
Hi smoupre
Here's a mock up enclosed.https://www.dropbox.com/s/a1vn650ta4j0u3y/Eksempel%20til%20BI%20Community.pbix?dl=0
I have changed the fieldnames etc to english :-)
As you se I only get the value of total hours per week (97). Not the total value for all employees (196).
And another problem is, that it doesnt show the values per employee group but the same value for all groups.