Table.FuzzyJoin

Table

Joins two tables using fuzzy (approximate) string matching on key columns.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.FuzzyJoin(table1 as table, key1 as any, table2 as table, key2 as any, optional joinKind as nullable number, optional joinOptions as nullable record) as table

Parameters

NameTypeRequiredDescription
table1tableYesThe left table.
key1anyYesThe key column name or list of column names from table1.
table2tableYesThe right table.
key2anyYesThe key column name or list of column names from table2.
joinKindnumberNoOptional. The join type: JoinKind.Inner (0), JoinKind.LeftOuter (1), JoinKind.RightOuter (2), JoinKind.FullOuter (3), JoinKind.LeftAnti (4), JoinKind.RightAnti (5). Defaults to JoinKind.Inner.
joinOptionsrecordNoOptional record supporting fields: Threshold (0.0–1.0 similarity), IgnoreCase, IgnoreSpace, NumberOfMatches, TransformationTable.

Return Value

tableA table resulting from joining the two tables using fuzzy key matching.

Remarks

Table.FuzzyJoin joins two tables using approximate string matching on key columns instead of exact equality. It tolerates typos, spacing differences, and case variations, making it useful when joining datasets from different sources where key values may not be standardized — such as customer names entered by hand, product descriptions from different vendors, or city names with varied spellings.

The joinOptions record supports these fields:

- Threshold (number, 0.0–1.0): minimum similarity for a match. Default 0.8. Lower values match more loosely; 1.0 is exact matching only. - IgnoreCase (logical): ignore case. Default true. - IgnoreSpace (logical): ignore whitespace. Default true. - NumberOfMatches (number): limit matches per left-table row. Default is all matches. - TransformationTable (table with From and To columns): pre-map known variants before scoring.

Table.FuzzyJoin returns a flat joined table (unlike Table.FuzzyNestedJoin, which returns nested tables). It does not fold to data sources. The default join kind is JoinKind.Inner — use JoinKind.LeftOuter to retain unmatched left rows. Be cautious with low Threshold values on large tables as performance can degrade significantly.

Examples

Example 1: Match Sales customer names against a canonical Customers table

let
    SalesWithTypos = #table(
        {"OrderID", "CustomerName", "Amount"},
        {{1,"Alise",250},{2,"Bobb",180},{3,"Charlie",300},{4,"Dianah",150}}
    ),
    Customers = #table(
        {"Name", "City", "State"},
        {{"Alice","New York","NY"},{"Bob","Chicago","IL"},{"Charlie","Houston","TX"},{"Diana","Seattle","WA"}}
    )
in
    Table.FuzzyJoin(
        SalesWithTypos, "CustomerName",
        Customers,      "Name",
        JoinKind.LeftOuter,
        [Threshold = 0.75]
    )
Result
OrderID
CustomerName
Amount
Name
City
State
11Alise250AliceNew YorkNY
22Bobb180BobChicagoIL
33Charlie300CharlieHoustonTX
44Dianah150DianaSeattleWA

Example 2: Use a TransformationTable to handle known aliases

let
    Orders = #table({"CustomerRef","Total"},{{"Al","500"},{"Robbie","200"},{"Diane","350"}}),
    Customers = #table({"Name"},{{"Alice"},{"Bob"},{"Diana"}}),
    Mapping = #table({"From","To"},{{"Al","Alice"},{"Robbie","Bob"},{"Diane","Diana"}})
in
    Table.FuzzyJoin(
        Orders, "CustomerRef",
        Customers, "Name",
        JoinKind.LeftOuter,
        [Threshold = 0.5, TransformationTable = Mapping]
    )
Result
CustomerRef
Total
Name
1Al500Alice
2Robbie200Bob
3Diane350Diana

Example 3: Limit to one match per left row with NumberOfMatches

Table.FuzzyJoin(
    #table({"Product"},{{"Widge A"},{"Gadgit B"}}),
    "Product",
    #table({"CanonicalName","Category"},{{"Widget A","Widgets"},{"Gadget B","Gadgets"}}),
    "CanonicalName",
    JoinKind.LeftOuter,
    [Threshold = 0.7, NumberOfMatches = 1]
)
Result
Product
CanonicalName
Category
1Widge AWidget AWidgets
2Gadgit BGadget BGadgets

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks