Join types
Choose a join by the business question
A merge matches records using equality of selected key values. The left and right sides matter: a left outer join retains every left observation, an inner join retains only matched pairs, a right outer join retains every right observation, and a full outer join retains unmatched observations from both sides. A left anti join returns left records with no right match; a right anti join reverses that question. Semi joins retain matching rows from the selected side without exposing the other side’s columns. The output grain depends on match multiplicity, not just on the chosen join kind. Unlike a semantic-model relationship, a merge produces a transformed query result at data preparation time. All M examples are standalone expressions for a blank query in a disposable Power BI Desktop Import lab. No credentials, external connector or paid service are required. Outputs are predictions; native M execution and exact Desktop build are NOT RUN. Treat row order as unspecified unless explicitly sorted.
Predict matched and unmatched observations
let Sales = #table(type table [LineID=text, ProductKey=text, RevenueUSD=number], {{"L1","P01",30},{"L2","P02",20},{"L3","P99",10}}), Products = #table(type table [DimKey=text, Category=text], {{"P01","Desk"},{"P02","Lamp"},{"P03","Chair"}}), Inner = Table.Join(Sales,{"ProductKey"},Products,{"DimKey"},JoinKind.Inner), Left = Table.Join(Sales,{"ProductKey"},Products,{"DimKey"},JoinKind.LeftOuter), Full = Table.Join(Sales,{"ProductKey"},Products,{"DimKey"},JoinKind.FullOuter), Orphans = Table.Join(Sales,{"ProductKey"},Products,{"DimKey"},JoinKind.LeftAnti)in [Inner=Inner, Left=Left, Full=Full, Orphans=Orphans]Inspect each field of the returned record. Inner: L1 and L2, revenue 50 USD. Left: three lines, revenue 60 USD, L3 has null lookup attributes. Full: four rows including unmatched P03 with null sale fields. Orphans: L3 only, revenue 10 USD. Null lookup fields do not imply a zero-priced sale. Table.Join defaults to Inner; Table.NestedJoin defaults to LeftOuter. Specify the kind explicitly. Use distinct column names or a deliberate projection/rename to avoid collisions.
Normalize composite keys before joining
let Sales = #table(type table [Store=text, SKU=text, Qty=number], {{"N"," 001 ",2},{"S","001",4}}), Stock = #table(type table [Site=text, Code=text, Available=number], {{"N","001",10},{"S","001",20}}), Clean = Table.TransformColumns(Sales,{{"SKU",Text.Trim,type text}}), Matched = Table.Join(Clean,{"Store","SKU"},Stock,{"Site","Code"},JoinKind.Inner)in MatchedExpected: N/001 quantity 2, available 10; S/001 quantity 4, available 20. Joining on SKU alone would return four pairs instead of two, repeating each quantity. Select corresponding composite key columns in the same order, with compatible types. Preserve leading zeros in identifiers. Trim only if the source key contract allows it, retain raw keys in staging and audit normalization collisions. Do not assume SQL collation or null comparison rules match M or a folded connector. Reject missing keys before matching; fuzzy matching is a separate, reviewed identity-resolution task, not a default.
Where should a merge run?
In a governed relational source, a source view or approved SQL join may reduce transferred rows and reuse constraints. M is useful for combining controlled inputs across sources. A connector may translate part of an M query into source operations (query folding); this is not guaranteed. Check the actual connector, query plan or available native-query inspection, and compare key semantics, counts, totals and permissions. Do not disable privacy protections to make a merge succeed. Privacy settings govern cross-source transfer; they do not grant source access. The inline tables here have no external engine to fold into.
Practice: audit the lost revenue
In example one add sale L4 with product P03 and revenue 15 USD. Predict inner and left row counts, revenue totals, and remaining orphan keys. Explain why an inner join is not an acceptable silent cleaning rule.