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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wes-shen-poal
Helper III
Helper III

keep row based on a column for duplicate IDs in Power Query

Hi there,

 

i have a data table with columns ServiceDirectionCode and DateTo

 

Capture.PNG

 

I would like this data table to give me all the different ServiceDirectionCodes, and for the duplicate codes, I only want to keep the row with the latest DateTo.

 

Is this possible to do in the Query Editor?

 

Thanks,

Wes

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

 

You may use the Group By feature and take the maximum of the DateTo column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

v-sihou-msft
Employee
Employee

@wes-shen-poal

 

As @Ashish_Mathur suggsted, just have your records group on Code level with max aggregation on Date column.

 

Animation.gif

 

Regards,

View solution in original post

3 REPLIES 3
v-sihou-msft
Employee
Employee

@wes-shen-poal

 

As @Ashish_Mathur suggsted, just have your records group on Code level with max aggregation on Date column.

 

Animation.gif

 

Regards,

Thanks @Ashish_Mathur@v-sihou-msft

 

Appreciate the help very much 🙂

 

Wes

Ashish_Mathur
Super User
Super User

Hi,

 

You may use the Group By feature and take the maximum of the DateTo column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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