- DAX Functions Tutorial
- DAX Functions - Home
- DAX Functions - Introduction
- DAX Parameter Naming Conventions
- Description Structure
- DAX Functions - Aggregation
- DAX Functions - Filter
- DAX Functions - Time Intelligence
- DAX Functions - Date and Time
- DAX Functions - Information
- DAX Functions - Logical
- Math & Trigonometric Functions
- DAX Functions - Parent & Child
- DAX Functions - Statistical
- DAX Functions - Text
- DAX Functions - Other
- DAX Functions Useful Resources
- DAX Functions - Quick Guide
- DAX Functions - Useful Resources
- DAX Functions - Discussion
DAX Filter - CALCULATE function
Description
Evaluates an expression in a context that is modified by the specified filters.
Syntax
CALCULATE (<expression>, [<filter1>], [<filter2>] …)
Parameters
Sr.No. | Parameter & Description |
---|---|
1 |
expression The expression to be evaluated. |
2 |
filter1, filter2, … Optional. A comma separated list of Boolean expressions or a table expression that defines a filter. |
Return Value
The value that is the result of the expression.
Remarks
The expression used as the first parameter is essentially the same as a calculated field.
If Boolean expressions are used as arguments, the following restrictions apply −
An expression cannot reference a calculated field.
An expression cannot use a nested CALCULATE function.
An expression cannot use any function that scans a table or returns a table, including aggregation functions.
However, a Boolean expression can use any function that looks up a single value, or that calculates a scalar value.
If the data has been filtered, the CALCULATE function changes the context in which the data is filtered, and evaluates the expression in the new context that you specify. For each column used in a filter argument, any existing filters on that column are removed, and the filter used in the filter argument is applied instead.
Example
= COUNTA (Results[Medal])/CALCULATE (COUNTA (Results[Medal], ALL (Results))