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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
mhq_
Regular Visitor

Use Power query to dynamically forecast days used per month on tasks based on startdate and duration

Hello,

 

I am fairly new to M code and have the need to dynamically forecast employee resourcing per month, based on start date and duration of tasks (See below Table).

 

For each row, I would like to translate the start date of tasks and duration (Days spent working on it) and dynamically forecast the days per month that would be used for it.  For example: 

 

       Index 0 starts working on a task from 5/11/2021 for 50 days, therefore in Column 1/11/2021 he would spend x days (days in month remaining from start date and checked against duration) working on it and this value gets input in Index 0 row for Column 1/11/2021 and if the days of the month 1/11/2021 run out and there are still days which are left in duration, then the remaining are assigned to the next month 1/12/2021 and so on and so forth, until the duration is completely forecasted for each month from start date.

 

I know I can do this in excel using normal excel formuals but I have a need to do this on power query and since I am very new to M code, I am struggling to develop a logic that enables me to perform this task. I would really appreciate some help with this.

 

 

mhq__0-1631584033399.png

 

Thank you!

 

 

1 REPLY 1
lbendlin
Super User
Super User

Power Query is a lot of things, but dynamic is not one of them.  For what you seem to be trying to achieve Excel formulas seem to be a better fit.

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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