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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.