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
integracaoti
Frequent Visitor

Create End Date Based on Next Task Start Date

Hi,

 

I'm a new Power BI user and I have the situation below (around 500+ rows and it continually grows).

Each Identification represents a different company (it's a registration ID), and every time an event takes place, we record it in our database (request issued, contract created, contract awaiting signature, contract signed), so it's really a step-by-step process with very different time/date ranges because it really depends on the client, we end up only saving the Start Date ([dataInicio]).

 

Inherently, the End Date is the next task's Start Date.

integracaoti_0-1609185452798.png

Therefore, my question is, how can I create an End Date column inheriting its values from the next activity's Start Date. Because in the end I want to create a timeline of events and create a Lead Time visualization.

I tried this which I found on the forum, after grouping by Identification and creating an Index column for each expanded table:

 

 

 

endDateRelatedNextTask = IF(CALCULATE(MIN(eventos[Index])) = MAX(eventos[Index]),NOW(), CALCULATE(MIN(eventos[dataInicio]),FILTER(eventos,eventos[Identification] = EARLIER(eventos[Identification]) && eventos[Index] = EARLIER(eventos[Index])+1)))

 

 

 

but it fired this:

A circular dependency was detected: eventos[endDateRelatedNextTask], 27be8294-902b-42c8-9948-d31633f644ae, eventos[endDateRelatedNextTask].

 

I couldn't find a solution for this Please help me!

Thank you in advance

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Does this calculated column formula work?

endDateRelatedNextTask = CALCULATE(MIN(eventos[dataInicio]),FILTER(eventos,eventos[Identification] = EARLIER(eventos[Identification]) && eventos[dataInicio] > EARLIER(eventos[dataInicio])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
integracaoti
Frequent Visitor

@Ashish_Mathuryour formula worked LIKE A CHARM! Thank you so much, with your help I even managed to make more complex visualizations.

I'm also thumbing up @StefanoGrimaldi and @MattAllington because you guys helped me with other stuff as well! Thank you very much for your time!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Does this calculated column formula work?

endDateRelatedNextTask = CALCULATE(MIN(eventos[dataInicio]),FILTER(eventos,eventos[Identification] = EARLIER(eventos[Identification]) && eventos[dataInicio] > EARLIER(eventos[dataInicio])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

here a similar  post that could help you solve this: https://community.powerbi.com/t5/Desktop/Find-next-value-by-date/td-p/503446 solved. 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




MattAllington
Community Champion
Community Champion

My video here should help you https://youtu.be/xN2IRXQ2CvI



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

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.

Top Solution Authors