Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Available days per week (planning)

Hi all,

 

I'm new to the all the DAX formula. And i'm struggeling to find the solution. I want to get the hours available for each consultant grouped by weeks. Like this:

 

Each day (except weekend) the consultants are able to make 8 hours. The consultants want to be able to see which weeks they have room voor new projects. When 8 hours are already planned on a specific day, they have no space left. The planning is recorded in the table Workorder. The days available have to be totaled per week. Unfortunately, I cannot assume that a consultant has 40 hours a week deducted by the planned hours that week. This is because, it is possible that consultant is planned twice in one day (more than 8 hours).

 

I made the following formula thanks to the Forum. But unfortunately it doesn't work properly as you can see. Per date the available hours are correct, but when totaled per week it doesn't work. See below the formula:

 

The table factworkorder[DurationTime] contains the amount of hours planned per date. It is possible that on a specific date there are no hours planned, so the available hours have to be 8 (1 day). Below the outcome of the formula above:

 

How can I achieve this? Thanks in advance!

7 Replies