Forum Discussion
Anonymous
1 year agoNot applicable
Merge Queries with different IDs
Hi, I have 2 tables that I want to merge, they both have ID's some of them they share and other they don't Table current month Table last month ID Value ...
tackytechtom
1 year agoMost Valuable Professional
Hi Anonymous ,
How about this?
Here the code in Power Query M that you can paste into the advanced editor (if you do not know, how to exactly do this, please check out this quick walkthrough)
Table current month
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Jca5DQAwCAPAXVxThHcZxP5rxJKvul04DP5wtgg21GRTLbbUZlsddtj7", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Value", Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"ID"}, #"Table last month", {"ID"}, "Table last month", JoinKind.FullOuter),
#"Expanded Table last month" = Table.ExpandTableColumn(#"Merged Queries", "Table last month", {"ID", "Value"}, {"Table last month.ID", "Table last month.Value"}),
#"Sorted Rows" = Table.Sort(#"Expanded Table last month",{{"ID", Order.Ascending}})
in
#"Sorted Rows"
Table last month
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0VYrViVYyATJNIExTINPUAMw0AzLNIKLmQKY5RNQCyLQAMmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Value", Int64.Type}})
in
#"Changed Type"
Let me know, how it goes 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Anonymous
1 year agoNot applicable
Hi,
As I understood you did a Fuller Outher join with the tables based on ID, this is what I did and is not working becuase of the blank rows