Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Sindre
Frequent Visitor

Estimated work capacity pr day based on FROM and TO dates

Need some help with creating a table.

For resource planning, I need to calculate the available capacity for each resource pr day. The estimated hours should be spread as average over the scheduled periode where available WorkHours>0.

 

 

TaskidResourceScheduleStartDateScheduleEndDateEstimatedHours
100PersonA02.01.202006.01.20206
101PersonA02.01.202003.01.202010
102PersonB02.01.202003.01.20208

 

Timetable

WorkDateWorkHours
02.01.20207
03.01.20207
04.01.20200
05.01.20200
06.01.20207

 

 

Result table

DateTaskidResourceEstAvgHours
02.01.2020100PersonA2
03.01.2020100PersonA 2
06.01.2020100PersonA2
02.01.2020101PersonA5
03.01.2020101PersonA5
02.01.2020102PersonB4
03.01.2020102PersonB4

 

This result table will be good for different summations and visualizations.

 

Regards Sindre

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

You should try a formula like this

Current Employees = CALCULATE(AVERAGEX(FILTER(TASK,TASK[ScheduleStartDate]<=max('Date'[Date]) && (ISBLANK(TASK[ScheduleEndDate]) 
 || TASK[ScheduleEndDate]>max('Date'[Date]))),(TASK[EstimatedHours]/datediff(ScheduleStartDate,ScheduleEndDate, DAY))),CROSSFILTER(TASK[ScheduleStartDate],'Date'[Date],None))

 

In case this did work create it a column first

(TASK[EstimatedHours]/datediff(ScheduleStartDate,ScheduleEndDate, DAY))

 

when you take task id and make it ungrouped it will show the required results

 

Referred to this article on similar problem : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Sindre ,
 
Unfortunately, it's hard to achieve exactly the same table you want, and the two tables you provide can't establish the right relationship.
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

You should try a formula like this

Current Employees = CALCULATE(AVERAGEX(FILTER(TASK,TASK[ScheduleStartDate]<=max('Date'[Date]) && (ISBLANK(TASK[ScheduleEndDate]) 
 || TASK[ScheduleEndDate]>max('Date'[Date]))),(TASK[EstimatedHours]/datediff(ScheduleStartDate,ScheduleEndDate, DAY))),CROSSFILTER(TASK[ScheduleStartDate],'Date'[Date],None))

 

In case this did work create it a column first

(TASK[EstimatedHours]/datediff(ScheduleStartDate,ScheduleEndDate, DAY))

 

when you take task id and make it ungrouped it will show the required results

 

Referred to this article on similar problem : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I got this formula to work, and it is sort of usable. This will only work on a day by day graph, and unfortunately not by f.ex week. Not sure how I should handle that. But thanks for the resolution.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.