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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rajasekar_o
Helper V
Helper V

login based leave calculation

hi team,
how to calculating leave 
I have employee logindetails 

EMPIDLOGIN DATETIME SHIFT
EMPS0011/4/20246.00 am1
EMPS0021/4/20246.00 am1
EMPJ0031/4/20246.00 am1
EMP0301/4/20246.00 am

1

EMP0321/4/20246.00 am

1

EMPS0012/4/20246.00 am

1

EMPS0022/4/20246.00 am1
EMP0302/4/20246.00 am1
    
    

 


EMPLOYEE

ID NAME
EMPS001KUMAR
EMPS002RAM
EMPJ003VENI
EMP030THAMO
EMP032VINOTH


IF the employee don't have login date than consider as leave 
(all days are working day)

1 ACCEPTED SOLUTION

Hi @rajasekar_o - Please find the attached file. 

 

rajendraongole1_0-1725441273827.png

 

Hope this helps

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

8 REPLIES 8
rajasekar_o
Helper V
Helper V

@rajendraongole1 
WHERE ican use 

this measure 

AllEmployeeDays =
CROSSJOIN(
    'Emplv',
    'Calendar'
)
rajasekar_o
Helper V
Helper V

AllEmployeeDays =
CROSSJOIN(
    'Emplv',
    'Calendar'
)
IT showing error
rajasekar_o_0-1725360574552.png
rajasekar_o_1-1725360759461.png

 

 

Hi @rajasekar_o -you have to create a calculated table using cross join funcion with Calendar and Employee tables to get a complete list of all employee dates that should have a login. 

 

AllEmployeeDays =
CROSSJOIN(
    'Emplv',
    'Calendar'
)
 
Please change or replace with your model level table names.
 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





rajendraongole1
Super User
Super 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])
)
 

rajendraongole1_0-1725355411266.png

 

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'
)
 
rajendraongole1_1-1725355539327.png

 

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"
)
 
rajendraongole1_2-1725355604151.png

 

 

Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





@rajendraongole1 I tried this, but it showed an error. Could you please share the application file?

Hi @rajasekar_o - Can you please upload the file in drive, i will look and update you on the same.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajasekar_o - Please find the attached file. 

 

rajendraongole1_0-1725441273827.png

 

Hope this helps

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors