Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Duplicate Values when Merging - Dynamic Index needed to filter out duplicates

Hello! 

I'm having an issue where several rows of my data are duplicating causing many different measures ($, Price, etc) to be overstated.

 

I'm merging two tables by a singular column (UPC) - I know why duplicates exist due to one of the tables having several of the duplicate values within it. As the UPC's are sold at several different markets. 

 

What I think I need to do is create a unique index column based off of several different columns (Market, UPC, Timing) - this column would need to be dynamic as the data is always changing. I think once this column is done I could remove duplicates?

 

I'm not thtat well versed in this but any help provided would be incredbily beneifical!

5 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

     

    You can Merge Queries on Multiple Columns, you just need to select them in the right order

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey Mariusz  thanks for the follow up. Unfortunately one of the tables I'm merging only has 3 columns. (As I'm only adding essential segmentation to another table). So one of the tables only contains 1 like column (UPC).

      • Mariusz's avatar
        Mariusz
        Icon for Community Champion rankCommunity Champion

        Hi Anonymous 

         

        You can use Group By 

         

         

        Best Regards,
        Mariusz

        If this post helps, then please consider Accepting it as the solution.

         

  • Jimmy801's avatar
    Jimmy801
    Icon for Community Champion rankCommunity Champion
    Hello

    In the join- function you could surround the table with the duplicated values with Table.Distinct to ensure the values are not doubled.

    Hope this helps

    Jimmy