Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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.
Name | Date |
Blue | 1/1/2022 |
Red | 8/4/2021 |
Blue | 5/1/2021 |
Blue | 4/2/2021 |
Green | 4/1/2021 |
Green | 2/3/2021 |
Example of what I need for results:
Name | Date | Next Date |
Blue | 1/1/2022 | null |
Red | 8/4/2021 | null |
Blue | 5/1/2021 | 1/1/2022 |
Blue | 4/2/2021 | 5/1/2021 |
Green | 4/1/2021 | null |
Green | 2/3/2021 | 4/1/2021 |
Any help would be greatly appreciated. Thank you in advance!
Solved! Go to Solution.
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
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
User | Count |
---|---|
13 | |
8 | |
8 | |
7 | |
5 |
User | Count |
---|---|
21 | |
15 | |
15 | |
10 | |
7 |