Forum Discussion
Identify Leave Rows with Matching Dates and One Entry Cancelled (0 Hours)
- 1 year ago
Hi Sunila please try this calculated column
IsCancellation =VAR CurrentEmployee = Sheet5[EmployeeID]VAR CurrentDate = Sheet5[LeaveDate]VAR CurrentHrs = Sheet5[Hrs]VAR CurrentStatus = sheet5[Status]RETURNIF (CurrentHrs = 0 && CurrentStatus = "Completed" &&CALCULATE (COUNTROWS (sheet5 ),FILTER (sheet5,sheet5[EmployeeID] = CurrentEmployee &&sheet5[LeaveDate] = CurrentDate &&sheet5[Hrs] >= 1 && Sheet5[Hrs] <= 8)) > 0,"Yes","No")
Hi Sunila ,
To identify cancellations in your leave data, you can create a calculated column that checks for two key conditions:
The current row shows 0 hours and has a "Completed" status (indicating a cancellation).
There is another row for the same employee and same leave date with a leave request between 1 to 8 hours (indicating the original request).
If both conditions are met, the 0-hour row is flagged as a cancellation of the original leave.
This approach will help you clearly distinguish between genuine leave entries and those that represent canceled requests.
***********************************************************************************************************************
If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!
Thank you,
Sarita