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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

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



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.





Thank you!



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

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors