Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Team,
We have attendance data of users for checkin and checkout in row. Now i want to add two columns and having each user checkin and checkout time by each day. Some users have multiple checkout and checkin. I want to pick earliest checkin and latest checkout.
Please help me to have DAX funtion to achieve this.
Solved! Go to Solution.
Hi @Syedsaddat00 ,
According to your description, you want to pick earliest checkin and latest checkout, right? Here are my steps you can follow as a solution.
(1)This is my test data.
(2)We can create a table.
Table 2 = SUMMARIZE('Table','Table'[userid],'Table'[name] , 'Table'[date],"checkin", CALCULATE(MIN('Table'[time]),'Table'[checkin/checkout]="checkin" ) , "checkout",CALCULATE(MAX('Table'[time]),'Table'[checkin/checkout]="checkout" ) )
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syedsaddat00 ,
According to your description, you want to pick earliest checkin and latest checkout, right? Here are my steps you can follow as a solution.
(1)This is my test data.
(2)We can create a table.
Table 2 = SUMMARIZE('Table','Table'[userid],'Table'[name] , 'Table'[date],"checkin", CALCULATE(MIN('Table'[time]),'Table'[checkin/checkout]="checkin" ) , "checkout",CALCULATE(MAX('Table'[time]),'Table'[checkin/checkout]="checkout" ) )
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Syedsaddat00 , New measure can do with other as group
calculate(Min(Table[Time]), filter(Table[Checkin/Checkout]= "Checkin"))
calculate(Max(Table[Time]), filter(Table[Checkin/Checkout]= "Checkout"))
if you need new table
groupby(Table, Table[userid], Table[Name], Table[date], "Check in", calculate(Min(Table[Time]), filter(Table[Checkin/Checkout]= "Checkin")), "Check Out", calculate(Max(Table[Time]), filter(Table[Checkin/Checkout]= "Checkout")) )
refer if needed
https://amitchandak.medium.com/power-bi-power-query-vs-dax-append-and-summarize-data-233f173d0839