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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.