Cheat Sheets/Power BI/TREATAS
DAX function

TREATASDAX 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

Related DAX functions

From Relationships

← Back to the Power BI (DAX) cheat sheet