OpenBI Docs Buy

CALCULATETABLE

Gives the rows of a table expression, worked out under filters its other arguments add, remove or replace.

Group: Filter. Compatible with DAX.

Syntax

CALCULATETABLE ( <expression> [, <filter1>] [, <filter2>] … )
ParameterTypeDescription
expressionTableThe rows wanted: any table expression, worked out under the filters that follow.
filter1Filter
optional
A condition on columns of one table, a table, or a modifier such as ALL or KEEPFILTERS.
filter2Filter
optional, repeatable
More filters; all of them apply together.

Returns

Table. The table expression's rows, worked out in the filter context the filters make.

Remarks

  • It is CALCULATE for a table: the same kinds of filters, a condition replacing the filter on its column in the same way, and context transition in a row context.
  • The filters reach everything inside it, measures added with ADDCOLUMNS too.
  • A filter changes only the tables it can reach. A condition on Sales does not narrow Products, because the relationship filters from Products to Sales: all four products come back, each with the liters of the year picked.

Examples

The beers

EVALUATE
CALCULATETABLE ( VALUES ( Products[Product] ), Products[Category] = "Beer" )
ORDER BY Products[Product]
Products[Product]
IPA
Lettøl
Pils

Each product's liters in 2025

EVALUATE
CALCULATETABLE (
    ADDCOLUMNS ( VALUES ( Products[Product] ), "Liters in 2025", [Liters sold] ),
    YEAR ( Sales[Month] ) = 2025
)
ORDER BY Products[Product]
Products[Product]Liters in 2025
Cider101510
IPA110336
Lettøl56630
Pils334877

CALCULATE, FILTER, KEEPFILTERS, ADDCOLUMNS, RELATEDTABLE.

Last updated · OpenBI Studio 0.3.74