DEPENDON DAX Function (Filter)

Changes a table expression so that its first columns depend on outer columns.

Syntax

DEPENDON ( <TableExpression>, <ColumnName> [, <ColumnName> [, … ] ] )
Parameter Attributes Description
TableExpression

Any table expression. Its first columns are matched with the outer columns.

ColumnName Repeatable

An outer column. The first ColumnName is matched with the first column of TableExpression, the second with the second, and so on.

Return values

Table An entire table or a table with one or more columns.

The rows of TableExpression where the first columns match the current values of the outer columns. The matched columns are not in the result.

Remarks

This function is mainly used internally by Power BI to query remote models in composite models.

DEPENDON makes a table expression depend on outer columns. The first column of the table depends on the first outer column. The second column of the table depends on the second outer column, and so on.

Each outer column must have a corresponding outer value. This value comes from the current row of an outer table function, such as GENERATE, ADDCOLUMNS or SELECTCOLUMNS. In SUMMARIZECOLUMNS, the value comes from the current group, when the outer column is a group-by column.

For each corresponding outer value, DEPENDON returns only the rows of the table where the first columns are equal to the outer values. Thus, DEPENDON works like an inner join between the outer values and the table. If no row matches, DEPENDON returns an empty table.

The result does not include the columns that DEPENDON uses for the match. It includes only the other columns of the table expression.

DEPENDON always uses the first columns of the table expression, in the order of the table. The column names do not matter. If the key columns are not the first columns, use SELECTCOLUMNS to move them to the first position.

The data type of each table column must be the same as the data type of the related outer column. If the data types are different, DEPENDON returns an error.

DEPENDON does not get the outer values from a filter. For example, CALCULATETABLE with a filter on the outer column does not change the result of DEPENDON. Window functions such as OFFSET use a different behavior: they also use the filter. If there is no corresponding outer value, the result can be an error, an empty table, or all the rows of the table. Do not use DEPENDON in that case.

In SUMMARIZECOLUMNS, if the outer column is not a group-by column, SUMMARIZECOLUMNS can return one row for each existing value of the outer column. These rows do not show the outer column. To get a clear result, include the outer columns in the group-by columns.

DEPENDON does not remove duplicates. If the table has two rows with the same key, DEPENDON returns both rows. If the outer table has the same value two times, DEPENDON runs two times.

» 6 related functions

Examples

DEPENDON makes the first column of Customers (Key) depend on CustomerList[Value]. For each value, GENERATE returns the customers with the same key. The result does not include the Key column.

DEFINE
    VAR Customers =
        SELECTCOLUMNS (
            { ( 1, "Alberto", "Italy" ), ( 2, "Daniele", "Italy" ), ( 2, "Marco", "USA" ), ( 3, "Claire", "France" ) },
            "Key", [Value1],
            "Name", [Value2],
            "Country", [Value3]
        )
    TABLE CustomerList = { 1, 2, 3 }
EVALUATE
GENERATE (
    CustomerList,
    DEPENDON ( Customers, CustomerList[Value] )
)
ORDER BY [Value], [Name]
Value Name Country
1 Alberto Italy
2 Daniele Italy
2 Marco USA
3 Claire France

CustomerList now contains the value 2 two times. GENERATE evaluates DEPENDON for each row of CustomerList. Thus, the result contains Daniele and Marco two times.

DEFINE
    VAR Customers =
        SELECTCOLUMNS (
            { ( 1, "Alberto", "Italy" ), ( 2, "Daniele", "Italy" ), ( 2, "Marco", "USA" ), ( 3, "Claire", "France" ) },
            "Key", [Value1],
            "Name", [Value2],
            "Country", [Value3]
        )
    TABLE CustomerList = { 1, 2, 2 }
EVALUATE
GENERATE (
    CustomerList,
    DEPENDON ( Customers, CustomerList[Value] )
)
ORDER BY [Value], [Name]
Value Name Country
1 Alberto Italy
2 Daniele Italy
2 Daniele Italy
2 Marco USA
2 Marco USA

DEPENDON can use more than one outer column. The first column of the table depends on the first outer column, the second column depends on the second outer column, and so on. The result has four rows. The Key and Name columns of Customers are not in the result. The result shows Key and Name from CustomerList and Country from Customers.

DEFINE
    VAR Customers =
        SELECTCOLUMNS (
            { ( 1, "Alberto", "Italy" ), ( 2, "Daniele", "Italy" ), ( 2, "Marco", "USA" ), ( 3, "Claire", "France" ) },
            "Key", [Value1],
            "Name", [Value2],
            "Country", [Value3]
        )
    TABLE CustomerList = SELECTCOLUMNS ( Customers, [Key], [Name] )
EVALUATE
GENERATE (
    CustomerList,
    DEPENDON ( Customers, CustomerList[Key], CustomerList[Name] )
)
ORDER BY [Key], [Name]
Key Name Country
1 Alberto Italy
2 Daniele Italy
2 Marco USA
3 Claire France

DEPENDON works like an inner join. The value 4 has no matching key, so DEPENDON returns an empty table and GENERATE removes the row. GENERATEALL keeps the row and returns blank values.

DEFINE
    VAR Customers =
        SELECTCOLUMNS (
            { ( 1, "Alberto", "Italy" ), ( 2, "Daniele", "Italy" ), ( 2, "Marco", "USA" ), ( 3, "Claire", "France" ) },
            "Key", [Value1],
            "Name", [Value2],
            "Country", [Value3]
        )
    TABLE CustomerList = { 1, 4 }
EVALUATE
GENERATE (
    CustomerList,
    DEPENDON ( Customers, CustomerList[Value] )
)
ORDER BY [Value], [Name]

EVALUATE
GENERATEALL (
    CustomerList,
    DEPENDON ( Customers, CustomerList[Value] )
)
ORDER BY [Value], [Name]
Value Name Country
1 Alberto Italy
Value Name Country
1 Alberto Italy
4 (Blank) (Blank)

The table expression can use a model table. The first column of SELECTCOLUMNS is Customer[CustomerKey], so this column depends on [Value]. The key 99999 does not exist, so the result has no row for it.

DEFINE
    VAR CustomerList = { 1, 3, 99999 }
EVALUATE
GENERATE (
    CustomerList,
    DEPENDON (
        SELECTCOLUMNS ( Customer, Customer[CustomerKey], Customer[Name] ),
        [Value]
    )
)
ORDER BY [Value]
Value Name
1 Yang, Jon
3 Torres, Ruben

You can use DEPENDON in other functions, not only in GENERATE. For each row of CustomerList, this query counts and concatenates the customers with the same key.

DEFINE
    VAR Customers =
        SELECTCOLUMNS (
            { ( 1, "Alberto", "Italy" ), ( 2, "Daniele", "Italy" ), ( 2, "Marco", "USA" ), ( 3, "Claire", "France" ) },
            "Key", [Value1],
            "Name", [Value2],
            "Country", [Value3]
        )
    TABLE CustomerList = { 1, 2, 3 }
EVALUATE
ADDCOLUMNS (
    CustomerList,
    "Names", CONCATENATEX ( DEPENDON ( Customers, CustomerList[Value] ), [Name], ", " ),
    "Rows", COUNTROWS ( DEPENDON ( Customers, CustomerList[Value] ) )
)
ORDER BY [Value]
Value Names Rows
1 Alberto 1
2 Daniele, Marco 2
3 Claire 1

This is an example from the Microsoft documentation. VTable[Country] is a group-by column of SUMMARIZECOLUMNS. Thus, the current group gives the corresponding outer value. Mexico has no rows, so the measure is blank and SUMMARIZECOLUMNS removes Mexico from the result.

DEFINE
    TABLE VTable = SELECTCOLUMNS ( { "USA", "Canada", "Mexico" }, "Country", [Value] )
EVALUATE
SUMMARIZECOLUMNS (
    VTable[Country],
    "Measure",
        SUMX (
            DEPENDON ( { ( "USA", 10 ), ( "USA", 11 ), ( "Canada", 12 ) }, VTable[Country] ),
            [Value2]
        )
)
Country Measure
USA 21
Canada 12

DEPENDON always uses the first columns of the table. Here Name is the first column, so Name depends on CustomerList[Value]. The result contains Key and Country, not Name. If the data types do not match, the query fails.

DEFINE
    VAR Customers =
        SELECTCOLUMNS (
            { ( 1, "Alberto", "Italy" ), ( 2, "Daniele", "Italy" ), ( 2, "Marco", "USA" ), ( 3, "Claire", "France" ) },
            "Key", [Value1],
            "Name", [Value2],
            "Country", [Value3]
        )
    TABLE CustomerList = { "Alberto", "Marco" }
EVALUATE
GENERATE (
    CustomerList,
    DEPENDON (
        SELECTCOLUMNS ( Customers, "Name", [Name], "Key", [Key], "Country", [Country] ),
        CustomerList[Value]
    )
)
ORDER BY [Value]
Value Key Country
Alberto 1 Italy
Marco 2 USA

Related functions

Other related functions are:

Last update: Oct 19, 2026   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://learn.microsoft.com/en-us/dax/dependon-function-dax

2018-2026 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Passed by Expression

This parameter is passed by expression and can be evaluated multiple times in different evaluation contexts.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of DEPENDON? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.


This site is protected by reCAPTCHA.