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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
CVanpat91
Frequent Visitor

Determine the next date a value appears

Hello,

 

I have a set of data where a certain value appears multiple times.  I want to know the next date that the value appears.  Example below of data.  

NameDate
Blue1/1/2022
Red8/4/2021
Blue5/1/2021
Blue4/2/2021
Green4/1/2021
Green2/3/2021

 

Example of what I need for results: 

NameDateNext Date
Blue1/1/2022null
Red8/4/2021null
Blue5/1/20211/1/2022
Blue4/2/20215/1/2021
Green4/1/2021null
Green2/3/20214/1/2021

 

 

Any help would be greatly appreciated.  Thank you in advance!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @CVanpat91 

you can create new column

Next Day =
VAR NameTable =
    CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Name] ) )
VAR NextDatesTable =
    FILTER ( NameTable, Data[Date] > EARLIER ( Data[Date] ) )
VAR NextDate =
    MINX ( NextDatesTable, Data[Date] )
RETURN
    NextDate

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @CVanpat91 

you can create new column

Next Day =
VAR NameTable =
    CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Name] ) )
VAR NextDatesTable =
    FILTER ( NameTable, Data[Date] > EARLIER ( Data[Date] ) )
VAR NextDate =
    MINX ( NextDatesTable, Data[Date] )
RETURN
    NextDate

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.