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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Find next start date in table

Hello everyone,

I have a table that looks like the following: An ID field, a phase, and the date the item was put in that phase (or the phase start date).

asodie_0-1711572710991.png

 

I want to add a column that finds the start date of the next phase for that ID. If there is no phase after the current one, the column should say null. I added an example of what that column would look like below.

asodie_1-1711572933053.png

 

My ultimate goal is to find how many days are spent in each phase. 

 

This is what I tried that did not work: 

phase end date =

VAR CurrentID = SELECTEDVALUE(Table[ID])
VAR CurrentDate = SELECTEDVALUE(Table[Phase Start])
VAR PhaseEndDate = CALCULATE(    
    MIN(Table[Phase Start]),    
    FILTER(Table, Table[ID] = CurrentID && Table[Phase Start] > CurrentDate) )

RETURN PhaseEndDate

The above code just returned all blank values.

 

Thanks!

5 REPLIES 5
vicky_
Super User
Super User

To get a new column for the next phase time:

next start = CALCULATE(MIN('Table'[Start]), REMOVEFILTERS('Table'[Start]), 'Table'[Start] > EARLIER('Table'[Start]))
Anonymous
Not applicable

Hi,

I get a circular dependency error when I tried this! Any ideas?

asodie_0-1711578683668.png

 

Anonymous
Not applicable

Thanks @vicky_ for your concern about this thread.

 

@Anonymous If you want a calculated column, you can modify your formula like below. This should work. 

phase end date = 
VAR CurrentID = 'Table'[ID] 
VAR CurrentDate = 'Table'[Phase Start]
VAR PhaseEndDate = CALCULATE(     
    MIN('Table'[Phase Start]),     
    FILTER('Table', 'Table'[ID] = CurrentID && 'Table'[Phase Start] > CurrentDate) ) 
RETURN PhaseEndDate

vjingzhanmsft_0-1711698064738.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Anonymous
Not applicable

This worked great on my dummy data (thank you!) but when I do it on my real, much larger dataset I get this error:

There's not enough memory to complete this operation. Please try again later when there may be more memory available.

Any ideas how to make it more memory efficient?

Anonymous
Not applicable

Hi @Anonymous 

Not sure if this would be more efficient, you may give it a try:

phase end date = 
VAR CurrentPhase = 'Table'[Phase]
RETURN
CALCULATE(MIN('Table'[Phase Start]),ALLEXCEPT('Table','Table'[ID]),'Table'[Phase]>CurrentPhase)

 

Best Regards,
Jing

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.