Merge and Append are two ways of combining queries in Power BI. MERGE is like a SQL JOIN and APPEND is like a SQL UNION.
On the one hand, when we MERGE queries, our table will be wider (it grows horizontally) because we are increasing the column count. Both tables involved in merging, should have columns with matching values (better said: a common column between tables) and we need to pay attention to the set of keys that we will choose to make this happen.
Two are the MERGE options: ‘Merge queries’ or ‘Merge queries as new’, and six are the possible join types:
INNER – only matching rows are visible.
LEFT OUTER – all rows in the first table are visible, but, from the second table, only matching rows.
RIGHT OUTER – all rows in the second table are visible, but, from the first table, only matching rows.
FULL OUTER – all rows are visible.
LEFT ANTI – all rows from the first table, which don’t have a match in the second table, are visible.
RIGHT ANTI – all rows from the second table, which don’t have a match in the first table.
On the other hand, when we APPEND queries, our table will be taller (it grows vertically) and consequently it increases the row count. Both tables involved in appending should have the same number of columns and order. Just like MERGE, APPEND also has two options: ‘Append queries’ or ‘Append queries as new’.
To MERGE or to APPEND queries, we need to be in Power Query Interface/Editor, ‘Home’ menu, as shown in the following image.
Comentários
Enviar um comentário