+ Reply to Thread
Results 1 to 7 of 7

Power query merge (many to many relationship) and remove duplicates

  1. #1
    Registered User
    Join Date
    12-02-2007
    Posts
    6

    Power query merge (many to many relationship) and remove duplicates

    Hi
    Several hours spent trying to think this one out with no success - hope there is an obvious solution that I am missing.
    I have 2 tables that I am merging and they have some many to many relationships.
    Post merge I am trying to remove those entries not required.
    (Maybe I should be appending not merging?)


    I have attached a very simplified file that should demonstrate my problem.
    Any help much appreciated.
    Thanks
    Richard
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,672

    Re: Power query merge (many to many relationship) and remove duplicates

    To merge two tables in PQ, you need to have a common field. You don't have that. Why not just copy and paste in Excel.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    12-02-2007
    Posts
    6

    Re: Power query merge (many to many relationship) and remove duplicates

    Hi

    The tables have a common field (apologies I probably did not explain that)
    But given 3 instances in table 1 and 3 in table 2 I end up with 9 possibilities when i only really want 3

    And this issue will repeat so it is not possible just to do a copy and paste

    Thanks
    Richard

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

    Re: Power query merge (many to many relationship) and remove duplicates

    You are going to need to provide more realistic data - at the very least including the common field!
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,672

    Re: Power query merge (many to many relationship) and remove duplicates

    Perhaps you should show us tables that have data that we can manipulate. Cannot visualize what you are saying. Look at the yellow banner at the top of this page how to upload a sample file.

  6. #6
    Registered User
    Join Date
    12-02-2007
    Posts
    6

    Re: Power query merge (many to many relationship) and remove duplicates

    Hi
    I have attached a more detailed file hopefully this will suffice to explain
    Thanks
    Attached Files Attached Files

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,672

    Re: Power query merge (many to many relationship) and remove duplicates

    The issue is you have a unique order number but really want to joining on Product Code which unfortunately is only in one table. I don't know if what you are looking for is possible with the current table configurations. Maybe someone else has an idea. Out of my wheelhouse.

+ 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. new entry in merge power query
    By rosscortb in forum Excel General
    Replies: 1
    Last Post: 04-24-2020, 05:02 AM
  2. Power query merge column
    By Eric Tsang in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-17-2020, 09:08 AM
  3. Power Query Merge Columns if Not Null
    By brent_milne in forum Excel General
    Replies: 1
    Last Post: 01-26-2020, 11:41 AM
  4. Replies: 3
    Last Post: 02-19-2019, 10:55 AM
  5. Power Query - merge by part of the string
    By zico8 in forum Excel General
    Replies: 1
    Last Post: 07-31-2017, 04:32 AM
  6. Merge Sheets Power Query
    By morerockin in forum Excel General
    Replies: 8
    Last Post: 04-11-2017, 08:17 AM
  7. Power Query, merge 2 or more large files in one
    By Remphan in forum Excel General
    Replies: 0
    Last Post: 03-02-2016, 04:28 AM

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