Forum Discussion
einrikr
5 years agoFrequent Visitor
Determine contract end date based on value from different row
Hi all, I have a data set like below: Reporting Date Employee number Name Pool Start date End date 1-1-2021 1 Peter Sales 01-01-2003 1-2-2021 1 Peter Sales 01-01-2003 ...
- 5 years ago
Hi, einrikr
Try a calculated column like the following:
End Date = VAR maxdate = CALCULATE ( MAX ( 'Table'[Start date] ), FILTER ( 'Table', 'Table'[Employee number] = EARLIER ( 'Table'[Employee number] ) ) ) // Select the largest date after grouping by 'Employee number' RETURN IF ( 'Table'[Start date] = maxdate, BLANK (), maxdate - 1 )Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 5 years ago
Hi,
This calculated column formula works
=if(CALCULATE(countrows(Data),FILTER(Data,Data[Employee number]=EARLIER(Data[Employee number])&&Data[Start date]>EARLIER(Data[Start date])))=0,BLANK(),CALCULATE(MIN(Data[Start date])-1,FILTER(Data,Data[Employee number]=EARLIER(Data[Employee number])&&Data[Start date]>EARLIER(Data[Start date]))))Hope this helps.
einrikr
5 years agoFrequent Visitor
Hi guys, thanks a ton for your solutions, I found they both work so I've selected both as a possible solution. It helped me out fantastically so I'm very grateful. Thanks very much for your help, much appreciated!
Ashish_Mathur
Super User
5 years agoYou are welcome.