Difficult comparison of two tables

I have two data tables.
The first is called “old” and the second is “new”.

  1. I have to merge the tables by removing duplicates if any, and in the left lines add the status “ok”. the previous lines must remain and the new entries deleted.

  2. If there were invoices in the “old” table and they are not in the “new” table, the status in the merged table should be “old”

  3. If there are invoices in the “new” table that are not in the “old” table, the status in the merged table should be “new”

I am enclosing an “old” and “new” table and a table how it should look like after merging.

Please help
Unfortunately, I can’t attach anything because the message "

“Sorry, new users can not upload attachments.”

Hi @aleksandra.kondraciuk

Welcome to forum

Can u share a screenshot of it

Thanks for your quick response :smiley:
I’m trying but I have a message:
Sorry, new users can only put one embedded media item in a post.
Read more here on how to easily remove this restriction.

table old:

|date of registration|Data|InvoiceNumber|Company|Value|

table new:

|date of registration|Data|InvoiceNumber|Company|Value|

|date of registration|Data|InvoiceNumber|Company|Value|Status|

then sample real tables are very large but number of columns, name and order are the same.
The number of rows in the table varies.

I solved the problem with power query.