TREATAS in DAX: virtual relationships and filter tables

How TREATAS applies the values of one table as a filter on columns of another in DAX, budgets at month and category grain, disconnected slicer tables, multi-column filters, fixed lists of values, why it beats FILTER with IN, and when a real relationship is better.

Short answer: TREATAS ( table, column1 [, column2, ...] ) takes the rows of a table and applies them as a filter on the columns you name, as if the values came from those columns. Inside CALCULATE it creates a virtual relationship: filter a Budget table by the months and categories selected on the Date and Product tables, even though there is no relationship. The number of columns must match, and values that do not exist in the target column are ignored.

Budgets, targets and forecasts usually sit at a coarser grain (month and category) than sales (day and product). A many-to-many relationship would work, but TREATAS keeps the model simple and the logic in the measure.

How does it work?

  1. 1
    Visual filterYear 2026, Category Bikes
  2. 2
    VALUESthe visible months and categories from Date and Product
  3. 3
    TREATAStreats them as Budget[Month] and Budget[Category]
  4. 4
    Budgetfiltered to the same months and category
TREATAS passes a filter from Date and Product to Budget
Budget =
CALCULATE (
    SUM ( Budget[Amount] ),
    TREATAS ( VALUES ( 'Date'[Year Month] ), Budget[Year Month] ),
    TREATAS ( VALUES ( 'Product'[Category] ), Budget[Category] )
)

Revenue vs Budget % = DIVIDE ( [Revenue] - [Budget], [Budget] )

At day or product level the budget shows the month or category value. Hide it below its grain with IF ( NOT ISINSCOPE ( 'Product'[Product] ), [Budget] ).

How do you filter several columns at once?

TREATAS with a multi-column table filters on combinations, not on each column separately:

Revenue of Budgeted Combinations =
CALCULATE (
    [Revenue],
    TREATAS (
        SUMMARIZE ( Budget, Budget[Year Month], Budget[Category] ),
        'Date'[Year Month],
        'Product'[Category]
    )
)

Only month and category pairs that exist in Budget filter the sales.

How do you use a fixed list or a disconnected slicer?

-- a fixed list
Main Markets Revenue =
CALCULATE ( [Revenue], TREATAS ( { "DE", "AT", "CH" }, Customer[Country] ) )

-- a slicer on a disconnected table 'Compare Region'
Compare Region Revenue =
CALCULATE (
    [Revenue],
    TREATAS ( VALUES ( 'Compare Region'[Region] ), Region[Region] )
)

The second lets readers pick a comparison region in its own slicer without filtering the rest of the page.

Why not FILTER with IN?

-- works, but slower on large columns
Budget Old =
CALCULATE (
    SUM ( Budget[Amount] ),
    FILTER ( ALL ( Budget[Category] ), Budget[Category] IN VALUES ( 'Product'[Category] ) )
)

TREATAS passes the values directly as a filter, which the engine handles efficiently; FILTER ... IN iterates the column and tests each value.

When is a relationship better?

SituationChoice
one budget per month and category, used in many measuresa relationship from a Month or Category bridge table, or TREATAS in one Budget measure
several relationships between the same tablesUSERELATIONSHIP (Microsoft's advice in the TREATAS reference)
an ad hoc filter from a disconnected slicerTREATAS
the grain matches and keys are uniquea normal one-to-many relationship

What goes wrong?

  • Wrong column count. The table and the column list must have the same number of columns, in the same order.
  • Type mismatch. A text month "2026-10" does not match a date; values that do not exist are silently ignored, so the result is blank.
  • Showing the budget below its grain. Daily budget values look like the monthly total on each day; hide them.
  • DirectQuery. Not supported in calculated columns or RLS rules in DirectQuery mode.

Where can you check this?

Where do you start?

Load your budget at month and category grain and write the Budget measure above. Budget variance turns it into a KPI.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.