Daily DAX : Day 466 NATURAL.JOINUSAGE

The DAX function NATURALJOINUSAGE 


This is a specialized, mostly undocumented table manipulation function. Based on the documentation from DAX Guide, it is not intended for standard report authoring but serves a specific role in complex data architectures.

Explanation of NATURALJOINUSAGE


The function is used to add a table as a Natural Join into the filter context.

Unlike common join functions like NATURALINNERJOIN, which return a physical-style table result, NATURALJOINUSAGE acts as a value filter within specific query structures.

Key Characteristics:

  •     Restriction: It can only be used as a value filter within the SUMMARIZECOLUMNS function.

  •     Internal Purpose: It is primarily intended for internal use by the Power BI engine.

  • Composite Models: It is specifically designed to handle queries sent to remote semantic models within a Composite Model (where one Power BI model connects to another Power BI dataset or Analysis Services model).
   
  •  Non-Recommended: Both Microsoft and DAX experts (like SQLBI) do not recommend using this function manually in your DAX measures or calculated columns, as it is considered "deprecated" or "unsupported" for general use.

Use Case


The primary use case for NATURALJOINUSAGE is cross-model filtering in a DirectQuery or Composite Model environment.

  1. Distributed Queries: When you have a local model that is related to a remote model, Power BI needs a way to "ship" filters from the local tables to the remote source.
  2. Maintaining Lineage: It helps the engine maintain the relationship and data lineage between tables that might reside in different data islands or "islands of data" within a composite model.
  3. Engine Automation: When you create a visual that combines data from a local Excel file and a remote Corporate Dataset, the engine might generate a query using NATURALJOINUSAGE to ensure that the filters from the local file are correctly applied to the remote data via a natural join logic.

Comparison with NATURALINNERJOIN


While they sound similar, they are very different:

    NATURALINNERJOIN: A standard DAX function used to join two tables into one based on common column names and lineage. You might use this in a variable to create a temporary table for calculation.

    NATURALJOINUSAGE: A specialized filter modifier for SUMMARIZECOLUMNS that defines how a join should influence the filter context across different parts of a composite model.

Recommendation: 


For 99% of Power BI development tasks, you should avoid this function and rely on standard relationships or functions like TREATAS and CROSSFILTER for advanced filter manipulation.

Comments

Popular posts from this blog

Daily DAX : Day 131 SELECTEDMEASURE

Daily DAX : Day 191 MROUND

Daily DAX : Day 142 COLLAPSEALL