+ Reply to Thread
Results 1 to 1 of 1

Power Query - removing duplicate data, but keeping second set?

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    Greater NYC Area
    MS-Off Ver
    Excel 2010
    Posts
    84

    Power Query - removing duplicate data, but keeping second set?

    I’ve got a big report that comes out of my database which I’m try cull down and extract just a few values from. The report is set up to provide one year’s worth of data on each tab. The report includes things like beginning value, new capital inflows, % ownerships, and ending value for each month of the year. I just want to extract the final ending value for each month. The tricky thing is that the report oftentimes (but not always) lists two ending values for each month – a preliminary ending value which doesn’t account for some one-off cash flows, and a final, correct, ending value which does. I went ahead and loaded it in power query and shaped it so all I have left are the ending values for each month, but I’ve got dupes because I can’t figure out how to differentiate between preliminary and final ending values for each month. The final ending value always appears later in the list (so farther to the right in the raw data, or further down the list in my transposed power query data set), so I can use that to help, but the data set skips around so I can’t map it out based on “Is Even” or “Is Odd”. I think I’m looking for a way to remove duplicates but keep the last duplicate value in the set instead of the default of keeping the first duplicate value in the set. That would make sure I keep the final ending value – but then again there’s probably an even better way which I’m not even thinking of.

    Attached is my file:
    Tab #1 – raw data from my system for year #1 (yellow highlights indicate which data I need to keep)
    Tab #2 – raw data from my system for year #2 (yellow highlights indicate which data I need to keep)
    Note – there are a few minor differences between Tab #1 & Tab #2 in terms of the header order
    Tab #3 – my desired final output
    Tab #4 – my attempt at shaping the data in power query (it doesn’t quite get me all the way there, but it’s very close!)

    Note – All the numbers are dummy data, so if the individual line items don’t tie to the totals out then that’s why.

    Any thoughts or suggestions would be greatly appreciated. Thanks in advance!
    Attached Files Attached Files

+ 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. 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
  2. Replies: 0
    Last Post: 04-05-2018, 01:16 AM
  3. Query help, removing duplicate Header rows
    By taylorsm in forum Excel General
    Replies: 7
    Last Post: 01-26-2018, 11:57 AM
  4. Duplicate filters in Power Query
    By leukep in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2017, 05:06 AM
  5. Unpivot in Power Query keeping two columns
    By PennyK in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-10-2017, 06:27 AM
  6. Finding and deleting 1 duplicate in power query
    By stephme55 in forum Excel General
    Replies: 1
    Last Post: 09-07-2016, 10:09 AM
  7. Removing/keeping duplicate entries
    By erlendee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2014, 01:32 AM

Tags for this Thread

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