Forum Discussion
rajasekar_o
2 years agoHelper V
login based leave calculation
hi team, how to calculating leave I have employee logindetails EMPID LOGIN DATE TIME SHIFT EMPS001 1/4/2024 6.00 am 1 EMPS002 1/4/2024 6.00 am 1 EMPJ003 1/4/2024 6.00 am ...
- 2 years ago
rajendraongole1
2 years agoSuper User
Hi rajasekar_o - I have loaded both tables along with created a new date table calendar as like below and given a relationship between all three as like below
used calculated tables to create a calendar table as below:
Calendar =
CALENDAR(
MIN('Leave'[LOGIN DATE]),
MAX('Leave'[LOGIN DATE])
)
Create a cross-join between the Calendar and Employee tables to get a complete list of all employee dates that should have a login.
AllEmployeeDays =
CROSSJOIN(
'Emplv',
'Calendar'
)
Create a calculated column the leaves by checking which dates do not have corresponding login entries in above new as leaves
Leave =
IF(
COUNTROWS(
FILTER(
'Leave',
'Leave'[EMPID] = 'AllEmployeeDays'[ID ] &&
'Leave'[LOGIN DATE] = 'AllEmployeeDays'[Date]
)
) = 0,
"Leave",
"Present"
)
Hope this helps.
- rajasekar_o2 years agoHelper V
rajendraongole1 I tried this, but it showed an error. Could you please share the application file?
- rajendraongole12 years agoSuper User
Hi rajasekar_o - Can you please upload the file in drive, i will look and update you on the same.