CALCULATETABLE DAX Function (Filter)  Context Transition

Evaluates a table expression in a context modified by filters.

Syntax

CALCULATETABLE ( <Table> [, <Filter> [, <Filter> [, … ] ] ] )
Parameter Attributes Description
Table

The table expression to be evaluated.

Filter Optional
Repeatable

A boolean (True/False) expression or a table expression that defines a filter.

Return values

Table An entire table or a table with one or more columns.

The value is the result of the expression evaluated in a modified filter context.

Remarks

Every filter argument can be either a filter removal (such as ALL, ALLEXCEPT, ALLNOBLANKROW), a filter restore (ALLSELECTED), or a table expression returning a list of values for one or more columns or for an entire expanded table.

When a filter argument has the form of a predicate with a single column reference, the expression is embedded into a FILTER expression that filters all the values of the referenced column. For example, the predicate shown in the first expression is internally converted in the second expression.

CALCULATETABLE ( 
    <table_expression>,
    table[column] = 10
)

CALCULATE ( 
    <table_expression>,
    FILTER ( 
        ALL ( table[column] ),
        table[column] = 10
    )
)

A filter argument overrides the existing corresponding filters over the same column(s), unless it is embedded within KEEPFILTERS.

CALCULATETABLE follow the same steps of CALCULATE to evaluate its result.

Related articles

Learn more about CALCULATETABLE in the following articles:

Related functions

Other related functions are:

Last update: Oct 13, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/calculatetable-function-dax

DAX Conventions
Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

Want to improve the content of CALCULATETABLE? Did you find any issue? Please, report it us!
All submissions will be evaluated for possible updates of the content.