Merge Queries in Power BI is essentially a join function. The function should therefore be used when we want to combine information from two tables that share a common key. In the example below, the common key is article_id.
First, we select the tables we want to merge and specify the matching columns. There is also an option to select which kind of join we want to use. In this example, we will use Left Outer, which keeps all the rows in the first table (Articles) and matching rows in the second table (Price and cost). In this instance, there is a match for all 381 rows in the first table.
After we perform the merge, we need to decide which columns we want to expand and thereby add to our original table. Here we keep both the cost and price columns.
After expanding the columns, we get the following table, where we now have data from both our original table (article_id, department_name and section_name) and our merged table (cost_sek and price_sek). This results in a complete article table and will reduce the number of tables needed in the data model.
Comments
Post a Comment