Continuing my series on new DAX functions in Excel 2016, here are two more: NaturalInnerJoin() and NaturalLeftOuterJoin(). Both do pretty much what you’d expect. Consider the following two tables in an Excel worksheet, called ColourFruit and FruitPrice: With these tables loaded into the Excel Data Model as linked tables, the next step is to create a relationship between the tables on the Fruit column: Both functions only work with two tables that have an active relationship between them, and both take two tables from the Excel Data Model as parameters. Once you’ve done that you can use these functions in a DAX query. The queries evaluate naturalinnerjoin(ColourFruit,FruitPrice) and evaluate naturalinnerjoin(FruitPrice,ColourFruit) …both perform an inner join between the two tables on the Fruit column and both return the same table: The query evaluate naturalleftouterjoin(ColourFruit,FruitPrice) …returns The query evaluate naturalleftouterjoin(FruitPrice,ColourFruit) …returns: For NaturalLeftOuterJoin() the table given in the first parameter is on the left-hand side of the left outer join, so all rows from it are returned, whereas the table in the second parameter is on the right-hand side of the join so only the matching rows are returned.
↧