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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
chillpill
Helper I
Helper I

Remove duplicates and keep lowest (min) time

I have the data set below and need to find the earliest time and the associated activity for each date. I attempted a Group By with Min as an aggregate but wasn't successful.

 

chillpill_1-1734461355247.png

 

Preferably, the results would look like the following. The status could either be Ready or Ringing depending on what time comes first on each date. 

 

EmployeeStatusDateTime
John SmithReady_11123112/97:13 AM
John SmithReady_11123112/107:06 AM
Margaret ChoReady_11123112/911:30 AM
Margaret ChoReady_11123112/1011:30 AM
Maddy KnockReady_111231

12/12

4:28 PM
Maddy KnockReady_11123112/1310:49 AM

 

The table formatting above works in the editing window but looks broken when posted. Sorry about that!

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You can try the following code as your Table.Group

= Table.Group(previousStep, {"Employee", "Date"}, {{"all", each Table.SelectRows(_, (r)=> r[Time] = List.Min([Time])), type table [Employee=nullable text, Status=nullable text, Date=nullable date, Time=nullable time]}})

Then expand the resulting table with the Time and Status columns.





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

Proud to be a Super User!





View solution in original post

1 REPLY 1
jgeddes
Super User
Super User

You can try the following code as your Table.Group

= Table.Group(previousStep, {"Employee", "Date"}, {{"all", each Table.SelectRows(_, (r)=> r[Time] = List.Min([Time])), type table [Employee=nullable text, Status=nullable text, Date=nullable date, Time=nullable time]}})

Then expand the resulting table with the Time and Status columns.





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

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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