DAX function
TREATAS — DAX function reference
Apply one table as a filter on another.
Syntax
dax
TREATAS(<table>, <columnName1> [, <columnName2>, …])
Examples
dax
CALCULATE([Sales], TREATAS(VALUES(Budget[Region]), Sales[Region]))
→ A number
dax
CALCULATE(SUM(Sales[Amount]), TREATAS(VALUES('Date Selector'[SelectedYear]), 'Date'[Year]))→ Applies a disconnected slicer table's selection as a filter on the real Date table
dax
CALCULATE(SUM(Sales[Amount]), TREATAS(FILTER(ALL(Product), Product[Margin] > 0.4), Product[ProductID]))
→ Filters Sales by a computed set of high-margin products with no direct relationship needed
Common mistakes & gotchas
- A virtual relationship — filters across tables that are not physically related.
- TREATAS matches by column position, not by name — the Nth column of the source table is applied as a filter on the Nth target column listed, so column order matters even if the names differ.
- It creates a genuine virtual relationship for that one calculation (unlike LOOKUPVALUE, which just looks up a value) — the standard technique for parameter tables and what-if scenarios where a physical relationship would be inappropriate or create ambiguity.
Related DAX functions
From Relationships