Forum Discussion
Merge and update History table from Update table having new or updated values
- 4 years ago
I'd recommend checking out these relevant resources for the self-referencing logic:
Self Referencing Tables in Power Query
Inserting text manually in a custom column and should be visible on refresh of the report
To do the update, I appended the tables together, grouped by ProductKey taking the latest version of the data, expanded the non-manual columns, and then merged back in the manual columns from the beginning of the query.
Please see the attached.
One question:
Incase there are already duplicate rows in the Updateable table, this does not seem to work!
for e.g in my real data, there are duplicate ProductKey rows where one row may have the manual columns filled in, and the other row may have nulls (blanks).
How to handle this situation in the `Updateable` table in the initial stage itself, before we combine it with `NewData` table?
Yeah, get rid of rows with blanks before combining. Maybe by doing a group by and taking the max over the manual columns?
- Anonymous4 years agoNot applicable
AlexisOlson just too many Manual columns. 😞
But i cleaned the data of duplicates and in m-code also used `RemovedDuplicates` over ProductKey column.
Not sure if i understood `Groupby and taking a Max over the Manual columns`...