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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sebastiandyrby
Resolver I
Resolver I

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 

 

 

 

sebastiandyrby_0-1675862524335.png

 

Any help or guidance is much appreciated!

0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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