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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Syedsaddat00
New Member

New column from conditional data

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.

 

 

Capture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vtangjiemsft_0-1665388768354.png

(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.

vtangjiemsft_1-1665388768357.png

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. 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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.

vtangjiemsft_0-1665388768354.png

(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.

vtangjiemsft_1-1665388768357.png

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. 

 

amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.