+ Reply to Thread
Results 1 to 7 of 7

Power Query - Remove Specific Duplicate Rows (Based on sort criteria)

  1. #1
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Power Query - Remove Specific Duplicate Rows (Based on sort criteria)

    I have a query with several columns. I sort them a certain way and want to remove duplicates (based on several columns) so that the first duplicate found from top down is kept and further duplicates are removed (like Excel removes duplicates).

    When I change the query sort order it doesn't seem to change which duplicate row is being removed (higher or lower), but I can't figure out what is determining the one to be removed.
    Last edited by kersplash; 03-22-2019 at 02:55 AM. Reason: edited title

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,814

    Re: Power Query - Remove Specific Duplicate Rows

    Attach a sample sheet that illustrates the issue.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Power Query - Remove Specific Duplicate Rows

    Please find the sample attached.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,814

    Re: Power Query - Remove Specific Duplicate Rows (Based on sort criteria)

    Thanks. You haven't said what you want it to do - how do you want PQ to determine the duplicate to leave in place? It seems to be going for the highest value in column 2. If we know what your criterion is, we can suggest a solution (by adding a column to flag the entries you want to keep and then filtering).

  5. #5
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Power Query - Remove Specific Duplicate Rows (Based on sort criteria)

    Quote Originally Posted by kersplash View Post
    I sort them a certain way and want to remove duplicates (based on several columns) so that the first duplicate found from top down is kept and further duplicates are removed (like Excel removes duplicates).
    Remove duplicates below the first sequentially following the sort.

  6. #6
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Power Query - Remove Specific Duplicate Rows (Based on sort criteria)

    Hi May be by applying a additional step Buffer.Table

    Refer the attachment...
    Attached Files Attached Files
    Click just below left if it helps, Boo?ath?

  7. #7
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Power Query - Remove Specific Duplicate Rows (Based on sort criteria)

    Quote Originally Posted by boopathiraja View Post
    Hi May be by applying a additional step Buffer.Table
    Great that works!

    Is there a button to apply the step?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] use formulas or power query to add/duplicate linked rows with data based on column
    By loganpmgoa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2019, 01:46 PM
  2. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  3. [SOLVED] Remove duplicate rows with specific conditions
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2016, 11:36 AM
  4. Remove Unique rows in Power Query
    By danielmorrison in forum Excel General
    Replies: 2
    Last Post: 03-11-2016, 09:06 AM
  5. Replies: 1
    Last Post: 12-11-2013, 09:09 PM
  6. Remove Duplicate Rows based on Specific Values
    By zeanzi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2013, 08:01 PM
  7. excel macro to remove specific columns and rows + remove duplicate
    By garrywelson in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-17-2013, 12:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1