Forum Discussion

sebastiandyrby's avatar
sebastiandyrby
Icon for Resolver I rankResolver I
3 years ago

Dynamically calculating start and end dates

Hi
I need to dynamically calculate the start and end dates for a number of projects. Each project has an area which can be used to calculate the duration of the project by dividing with a month/ha user input (say 10 ha/year). Each project also has two scores which can be weighted together with user inputted weights (say 2 and 3 for score 1 and 2) to achieve a project score, which is then calculated using a measure. These scores define the prioritization, where the project with the highest score is first in line. A sample of the table looks like the one below with defined measures included:

 

Project IDAreaDuration (measure)Score1Score2Project score (measure)Prioritization (measure)
ID_0181,813112
ID_1555,522103
ID_2323,245231

 

Based on this prioritization, I need to calculate the start and end dates for each project. Suppose I have 10 projects but only two projects can be ongoing at the same time. Thus, I need the first two projects to start at say 2024-01-01, and then - based on the duration - when the first of the projects end, the project with rank 3 can begin and so on. 

 

I have calculated the first few steps, but now I'm stuck. I need to get the second lowest date in a new step. But I also wonder if there's a smarter way to do this. My initial code bit is pasted below (and in the sample file). The sample file of the problem can be found in this Power BI-file: 

https://easyupload.io/wzwj4y 

 

 

 

 

Any help or guidance is much appreciated!

No RepliesBe the first to reply