Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Overwrite already existing rows when refreshing

I have a database with dates that is refreshed every X hours. I want once I hit the refresh button to overwrite the rows that have the same Date with the new data.

 

Currently, when I hit the the refresh button I get duplicates of the same date. I don't want that.

How could I fix this?

 

Thank you

 

  • vivran22's avatar
    vivran22
    7 years ago

    Anonymous 

     

    Hi,

     

    I feel that in this scenario removing duplicates is a better option to go with as compared to merge table, considering the fact the there is a single souce table.

     

    Rgds,

    Vivek

     

    PS: It is good that you are asking questions. That is how we all learn :)

9 Replies

  • vivran22's avatar
    vivran22
    Community Champion

    Anonymous 

     

    Hi,

     

    You may use tips from the article having similar issue

     

    Rgds,

    Vivek

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for the help vivran22. This is a nice article.

       

      However, I want this to be done automatically, once I hit the "refresh" button.

      If I have the 2 queries the article says (the original data and the override data), how can I perform the merge and append functions automatically?

       

      Thank you.

      • vivran22's avatar
        vivran22
        Community Champion

        Anonymous 

         

        Hi,

         

        Ususally when you hit refresh, Power Query will perform all those tasks (which includes merge and append) which has been defined in the Edit Query mode. So, your entire process should  be automated will work with the refresh button.

         

        Otherwise, you may share the sample files and I would like to recreate it for the demonstration purpose.

         

        Rgds,

        Vivek