TREATAS Function in DAX

The TREATAS function in DAX is used when we need to filter a table based on values from another table, especially when there’s no direct relationship between them.

What is TREATAS?

TREATAS treats the values in one column (or multiple columns) as if they belong to another column in a different table. It essentially applies filter context from one table onto another table’s columns—even if there's no relationship between the tables.

DAX Syntax

TREATAS(table_expression, column1[, column2[, column3[,…]]])

The function has the following parameters:

The number of columns specified must match the number of columns in the table expression and be in the same order.

Example: Let’s we have the following table named “Countries”.

TREATAS DAX Function in Power BI

Let’s we have another table named “Company Sales”.

TREATAS DAX Function in Power BI

In the model view we can see there is no relationship between these tables.

TREATAS DAX Function in Power BI

Let’s create a measure with name “TREATAS Measure”.

DAX

TREATAS Measure = 
CALCULATE(
    SUM(Countries[Population (Millions)]),
    TREATAS(
        VALUES('Company Sales'[Year]),
        Countries[Year]
    )
)        

This will filter the Countries table as if the selected year in “Company Sales” are coming directly from Countries.

TREATAS DAX Function in Power BI

The image demonstrates the use of the TREATAS function in Power BI to filter data across unrelated tables. A slicer filters the Company Sales[Year] column (showing 2022), and the “TREATAS Measure” uses this selection to filter the Countries table by mimicking a relationship. As a result, the TREATAS Measure displays the 2022 population total (3,500.20 million), matching the population for that year in the Countries table. The breakdown by country also shows only the values for 2022, confirming that TREATAS successfully applies the year filter without a direct relationship in the data model.

Key Notes: