The TREATAS Function In DAX

Kevin Feasel

2017-12-07

DAX

Matt Allington explains what the TREATAS function does:

The TREATAS function can be used to detect filters from your visual (filter context) and then apply these filters to a disconnected table in your data model.

  • It takes a source table (first parameter) and applies the values from that table to columns in a target table (second and subsequent parameters).

  • You can use a function like VALUES as the first parameter to detect the initial filter context in a visual and hence TREATAS can propagate filter context to the target table.

  • You do not need to have a physical relationship between the source table and the target table.  It therefore means that TREATAS can be used as a virtual many to many relationship.

  • You can pass multiple filters (columns) from the source table to the target table.  TREATAS can therefore can be used to apply multiple relationships (ie on more than one column) between tables.

Read on for a good example of how this works.

Related Posts

DAX: Caching And IF Statement Optimization

Kevin Feasel

2018-06-05

DAX

Marco Russo shows us a way of improving performance on conditional statements: Consider the following measure. 1 2 3 4 5 Margin := IF (     [Sales Amount] > 0 && [Total Cost] > 0,     [Sales Amount] - [Total Cost] ) The basic idea is that the difference between Sales Amount and Total Cost should be […]

Read More

Replacing DAX PathContains With OR

Chris Koester shows the performance benefits of replacing the PathContains function in DAX with a simple OR operator: This post shows how you can generate optimized multi-value DAX parameters in SSRS and achieve greater performance compared to the DAX PathContains function. This will be a short post that provides the SSRS expression to convert multiple SSRS parameters […]

Read More

Categories

December 2017
MTWTFSS
« Nov Jan »
 123
45678910
11121314151617
18192021222324
25262728293031