Forum Discussion
Problem calculation total work hours
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.
- HenrikH299 years agoAdvocate 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.
- HenrikH299 years agoAdvocate I
No, when it's set both ways i get the same values like you (correct values) but the total is wrong.
The total is 97 but has to be 196 ?
- ceebu9 years agoAdvocate I
I believe the reason is because there does not exist any relationship between the Count of employees and the number of hours they have worked.
(In your excel file, you are multiplying total number of employees per calendar into the total hours per calendar to get the total value).
To replicate the same behaviour I have added a new column "Emloyee Total Hours" with the following formula:
Employee Total hours = CALCULATE(SUM(WorktimeCalender[Hours]),WorkTimeCalendarName[Calender no] = EARLIER(Employee[Calenderno]))
Then, when I use to total with this column, here is what I see:
Hope this achieves what you want :-)