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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
frankhofmans
Helper IV
Helper IV

Search value of next date

hi all,

 

I have a table with omission percentages (of sick employees) and the start date. For example:

 

Case IDStart DateAbsenteeism percentage
C00110-04-2023100
C00125-04-202330
C00127-04-20230
C00215-04-2023100
C00220-04-202390
C00230-04-20230
   

 

I want to add a column with the end date. In the case of C001, the end date of the first row has to be 24-04-2023 (start date of next row -1), the end of the second row has to be 26-04-2023. In the third row, the end date has to be 27-04-2023 (same as the start date, because there is no "later" row of that caseID). Is there a opposite of the earlier function (my first instinct to solve this), or do you guys have another solution (plus formula)?

 

Many thanks in advance,

Regards,

Frank

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @frankhofmans 

 

You can try the following methods.

End Date = 
Var _nextdate=MINX(FILTER('Table',[Start Date]>EARLIER('Table'[Start Date])&&[Case ID]=EARLIER('Table'[Case ID])),[Start Date])
Return
IF(_nextdate=BLANK(),[Start Date],_nextdate-1)

vzhangti_0-1695954780121.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @frankhofmans 

 

You can try the following methods.

End Date = 
Var _nextdate=MINX(FILTER('Table',[Start Date]>EARLIER('Table'[Start Date])&&[Case ID]=EARLIER('Table'[Case ID])),[Start Date])
Return
IF(_nextdate=BLANK(),[Start Date],_nextdate-1)

vzhangti_0-1695954780121.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors