• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Removing Rows with the same ID, Keep the latest entry|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Removing Rows with the same ID, Keep the latest entry|Power Query|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryRemoving Rows with the same ID, Kee…
sp_PrintTopic sp_TopicIcon
Removing Rows with the same ID, Keep the latest entry
Avatar
Greg Sasser

Active Member
Members

Dashboards

Power Query

Power Pivot

Xtreme Pivot Tables

Excel Expert
Level 0
Forum Posts: 4
Member Since:
May 21, 2021
sp_UserOfflineSmall Offline
1
May 4, 2023 - 11:45 pm
sp_Permalink sp_Print

Hello, I have a data table that needs to be updated daily with new entries containing duplicate IDs within the ID column. I am looking for a solution to remove the previous rows that match the new entry based on the ID number while keeping the latest entry intact. I have tried to come up with a solution but need help. Could you please provide me with the necessary Mcode or guidance to help me create this process? Thank you.

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 0
Forum Posts: 490
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
2
May 5, 2023 - 12:05 am
sp_Permalink sp_Print

Could you please upload a file with some sample data that resembles your real situation? It's so much easier to help with some real data to work with.

Avatar
Greg Sasser

Active Member
Members

Dashboards

Power Query

Power Pivot

Xtreme Pivot Tables

Excel Expert
Level 0
Forum Posts: 4
Member Since:
May 21, 2021
sp_UserOfflineSmall Offline
3
May 5, 2023 - 12:32 am
sp_Permalink sp_Print

My apologies. I appreciate your help. I have attached a sample data file.

Avatar
Alan Sidman
Steamboat Springs, CO
Member
Members


Trusted Members
Level 0
Forum Posts: 150
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
4
May 5, 2023 - 1:28 am
sp_Permalink sp_Print

How do you identify the latest entry.  The only dates I see are listing and closing dates.  Am I missing something?

Avatar
Greg Sasser

Active Member
Members

Dashboards

Power Query

Power Pivot

Xtreme Pivot Tables

Excel Expert
Level 0
Forum Posts: 4
Member Since:
May 21, 2021
sp_UserOfflineSmall Offline
5
May 5, 2023 - 1:57 am
sp_Permalink sp_Print sp_EditHistory

As new data is added, it is appended. I am a newbie here. My thought was to add an index column as one of the first steps. I don't know, really. Maybe I need to add a date column to the raw data before loading it to power query? 

The CDOM (Cumulative Days on Market) column may be the best resource for identifying the latest entry unless there were multiple changes to an MLSNumber on the same day. I really don't know what the best practice is.

Your guidance is appreciated!

Avatar
Alan Sidman
Steamboat Springs, CO
Member
Members


Trusted Members
Level 0
Forum Posts: 150
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
6
May 5, 2023 - 8:34 am
sp_Permalink sp_Print

In my mind the best method would be a date time field that indicates the updates. Then the latest record can be maintained and any earlier records removed.  Update your workbook to indicate same and we can then provide a functional solution.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Magnolia Stellata
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 216
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Melanie Ford
Isaac Felbah
Adele Glover
Hitesh Asrani
Rohan Abraham
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Forum Stats:
Groups: 3
Forums: 24
Topics: 6356
Posts: 27793

 

Member Stats:
Guest Posters: 49
Members: 32324
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.