nerdexam
Microsoft

DP-500 · Question #64

You use Advanced Editor in Power Query Editor to edit a query that references two tables named Sales and Commission. Sample data for Sales (OrderID, SalesPerson, Amount) and Commission (Person…

The correct answer is B. LeftOuter. To merge tables without losing any rows from the Sales table while adding matching Commission data, a JoinKind.LeftOuter join should be used.

Query and transform data

Question

You use Advanced Editor in Power Query Editor to edit a query that references two tables named Sales and Commission. Sample data for Sales (OrderID, SalesPerson, Amount) and Commission (Person, Commission) is provided. You need to merge the tables without losing any rows in the Sales table. How should you complete the join kind parameter: '(Sales, "SalesPerson", Commission, "Name", JoinKind.['option'])'?

Options

  • ALeftAnti
  • BLeftOuter
  • CRightAnti
  • DRightOuter

How the community answered

(37 responses)
  • B
    92% (34)
  • C
    5% (2)
  • D
    3% (1)

Why each option

To merge tables without losing any rows from the `Sales` table while adding matching `Commission` data, a `JoinKind.LeftOuter` join should be used.

ALeftAnti

A `LeftAnti` join returns only the rows from the left table (`Sales`) that have no match in the right table (`Commission`), which would lose all `Sales` rows that do have a match.

BLeftOuterCorrect

A `LeftOuter` join returns all rows from the first (left) table, `Sales` in this case, and the matching rows from the second (right) table, `Commission`. If there is no match for a row in `Sales`, the columns from `Commission` will have null values, thereby ensuring that no rows from the `Sales` table are lost, which directly addresses the requirement.

CRightAnti

A `RightAnti` join returns only the rows from the right table (`Commission`) that have no match in the left table (`Sales`), which would definitely lose all rows from the `Sales` table.

DRightOuter

A `RightOuter` join returns all rows from the right table (`Commission`) and the matching rows from the left table (`Sales`). This would lose `Sales` rows that do not have a corresponding entry in `Commission`.

Concept tested: Power Query M function Table.Join JoinKind types

Source: https://learn.microsoft.com/en-us/powerquery-m/table-join

Topics

#Power Query#Table Merge#Join Types#M Language

Community Discussion

No community discussion yet for this question.

Full DP-500 Practice