Forum Discussion

pawelj795's avatar
pawelj795
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Remove duplicates with grouping by, leave most recent value

Hi, I'm currently working on filtering out old BOM's which my company replaced with new ones. Below, there is a table with BOM lines. The same BOM always has the same parent_product_tmpl_i...
  • PhilipTreacy's avatar
    5 years ago

    Hi pawelj795 

     

    Download example PBIX file and data

     

    I'm not sure I've followed your logic totally as I end up with a LOT of rows for each parent_product_tmpl_id.

    But according to what you've described I soudl be grouping on the parent_product_tmpl_id field and not the bom_id field.

     

    In my file above, check the Merge1 query for this results table.  I had to recreate your data from your tables in the Data Model as I couldn't open your query and access your SQL source.  The data is with the PBIX file above.

     

    Regards

    Phil