Forum Discussion
Anonymous
4 years agoNot applicable
Merge tables, adding new values
Dear community,
I need a help merging two tables yet adding new values, as shown in the picture below
The Stock table should be left outer join. So the new tables should include all values from table Stock, respective Inbound for matched articles and new articles from table Inbound with respective values.
Would be grateful for any tips!
let Stock = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJSitWJVnKCs5whrFgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Article = _t, Stock = _t]), Inbound = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitWJVnKGs1zgLDcIKxYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Article = _t, Inbound = _t]), #"Merged Queries" = Table.NestedJoin(Stock, "Article", Inbound, "Article", "In", JoinKind.FullOuter), #"Expanded In" = Table.ExpandTableColumn(#"Merged Queries", "In", {"Article", "Inbound"}, {"Article.1", "Inbound"}), #"Combined Columns" = Table.CombineColumns(#"Expanded In", {"Article.1", "Article"}, each if _{0} = _{1} then _{0} else _{0}??"" & _{1}??"", "Article") in #"Combined Columns"
3 Replies
- amitchandakSuper User
Anonymous , Merge in Power Query. Append you can also explore
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
Merge Tables (Power Query) : https://www.youtube.com/watch?v=zNrmbagO0Oo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=16
- CNENFRNLCommunity Champion
let Stock = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJSitWJVnKCs5whrFgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Article = _t, Stock = _t]), Inbound = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitWJVnKGs1zgLDcIKxYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Article = _t, Inbound = _t]), #"Merged Queries" = Table.NestedJoin(Stock, "Article", Inbound, "Article", "In", JoinKind.FullOuter), #"Expanded In" = Table.ExpandTableColumn(#"Merged Queries", "In", {"Article", "Inbound"}, {"Article.1", "Inbound"}), #"Combined Columns" = Table.CombineColumns(#"Expanded In", {"Article.1", "Article"}, each if _{0} = _{1} then _{0} else _{0}??"" & _{1}??"", "Article") in #"Combined Columns" - AnonymousNot applicable
thanks for help everyone!