Forum Discussion
twofingertyper
1 year agoHelper III
Two tables, differing data - merge, append new or other?
Hi all, I have two tables - one that runs for a longer period (AllSales) and one that is shorter, but captures cancelled sales (SalesStatus). They do not have identical columns, but both have a...
- 1 year ago
let Source = #"All Sales" & #"Sales Status", #"Grouped Rows" = Table.Group(Source, {"SalesOwnerID", "Date", "Status", "ProductID", "UniqueID"}, {{"Value", each List.Sum([Value]), type nullable number}}) in #"Grouped Rows"
twofingertyper
1 year agoHelper III
Then we can add in a uniqueID from the fields present, due to the nature of the sales someone cannot have a successful and cancelled order in the same day - so there will only be one status per day and any totals for a day (where there's a matching salesowner and productID) can be rolled up into one.
My issue is that I currently try to append the two tables and get a result that produces duplicate lines as opposed to merging everything into a single row.
lbendlin
1 year agoSuper User
let
Source = #"All Sales" & #"Sales Status",
#"Grouped Rows" = Table.Group(Source, {"SalesOwnerID", "Date", "Status", "ProductID", "UniqueID"}, {{"Value", each List.Sum([Value]), type nullable number}})
in
#"Grouped Rows"
- twofingertyper1 year agoHelper III
Thanks - that works, I did wonder about the impact of grouping larger data chunks, but this will work for now I think.