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! Learn more

Reply
rajasekar_o
Helper V
Helper V

login logout time calculate

Hi team ,

i have Login logout data, need to calculate IN TIME and OUT TIME 
IN TIME  min of login time 
in time must  between 9:30.00 am to 8:30:00 pm 

out time
if the employee have logout time on that date the take max of logout time ,if ther is no logout time on that date the check nexday before 9:30:00am take that time is logout time other wise is empty 

 

rajasekar_o_2-1706076577741.png

 how to calculate intime and out time expected output

rajasekar_o_3-1706076602707.png

  i try but not come correctly

rajasekar_o_0-1706080233191.png

 

 

 

11 REPLIES 11
rajasekar_o
Helper V
Helper V

HI TEAM , i have employee login  data  and name of employee data 
need to calculate in time and out time , i try more time but its not working 

rajasekar_o_0-1706188827070.png

rajasekar_o_3-1706189823696.png

i

"I want to calculate the 'in time' and 'out time' for employees.
The 'in time' should be the maximum 'intime' recorded between 9:30 am and 2:00 pm on a given date. If there is no 'in time' recorded, it should be blank.

For 'out time', if an employee has recorded an 'out time' on a specific date, it should be the maximum 'out time' for that date. If there is no 'out time' recorded, check the next day. If an 'out time' is recorded before 6:00 am on the next day, use that as the 'out time'; otherwise, 'out time' should be blank."
i give the expected output

 

rajasekar_o_1-1706189740980.png

rajasekar_o_2-1706189757000.png

 

 

@rajasekar_o 

 

check the solution here . 

i guess it is the same logic with some minor differences. 

https://community.fabric.microsoft.com/t5/Desktop/Payroll-Data/m-p/3657730

 

if you still have any problems, i will be more than happy to assist you 

 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos 👍🤠

rajasekar_o
Helper V
Helper V

Hi team ,

i have Login logout data, need to calculate IN TIME and OUT TIME 
IN TIME  min of login time 
in time must  between 9:30.00 am to 8:30:00 pm 

out time
if the employee have logout time on that date the take max of logout time ,if ther is no logout time on that date the check nexday before 9:30:00am take that time is logout time other wise is empty 

 

rajasekar_o_2-1706076577741.png

 

i need out put intime and out time  i try but not come correctly , how to calculate intime and out time

rajasekar_o_3-1706076602707.png

 

 

 

Hello @rajasekar_o ,

 

you need first to split the date time column into two columns date column and time column.

check the following link for this first step https://youtu.be/RR5XvbRwCxI?si=GC__37R_Cv_zKc0L

 

then unpivot the table so you could have it as the expected result 
check this out https://youtu.be/URAJ_aDiREE?si=WPHNf8S4zo14MmQ5

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




not working 

 

Anonymous
Not applicable

Hi @rajasekar_o ,

 

I made many attempts, you can check the pbix file.

vtianyichmsft_0-1706166479297.png

vtianyichmsft_1-1706166530115.png

 

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

its working only one employee if employee added is not working 

Anonymous
Not applicable

Hi @rajasekar_o ,

 

Just include the name as one of the conditions.Try the following expression:

IN = var _t = ADDCOLUMNS('Table',"AM",MINX(FILTER(ALL('Table'),IF([Measure]<=14.5,[Name]=EARLIER([Name])&&[datetime.1]=EARLIER([datetime.1])&&[type ]="IN",[Name]=EARLIER([Name])&&[datetime.1] -1=EARLIER([datetime.1])&&[type ]="IN")),[datetime.2]))
RETURN MINX(_t,[AM])

OUT = var _t = ADDCOLUMNS('Table',"AM",MAXX(FILTER(ALL('Table'),IF([Measure]<=14.5,[Name]=EARLIER([Name])&&[datetime.1]=EARLIER([datetime.1])&&[type ]="OUT",[Name]=EARLIER([Name])&&[datetime.1] -1=EARLIER([datetime.1])&&[type ]="OUT")),[datetime.2]))
RETURN MAXX(_t,[AM])

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

PijushRoy
Super User
Super User

Hi @rajasekar_o 

Can you please share sample data in Excel format




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





empnamedatetimetype 
Ram20.11.2023,09:30:00IN
Ram20.11.2023,09:30:02IN
Ram20.11.2023,20:30:01OUT
Ram21.11.2023,9:30:02IN
Ram22.11.2023,2:30:02OUT
Ram22.11.2023,09:30:02IN
Ram22.11.2023,20:30:02OUT
Ram22.11.2023,20:50:00OUT
Ram23.11.2023,09:50:00IN
Ram24.11.2023,09:50:00IN 
Ram24.11.2023,20:30:00OUT
Ram24.11.2023,20:50:22OUT

data

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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