CALCULATE DAX Function

The CALCULATE function modifies the filter context by adding or removing filters or by modifying standard filter behavior.

DAX Syntax CALCULATE(Expression[, Filter1 [, Filter2 [, …]]])

Example: The following Sheet1 table measure definition produces a sum, but only for country that have value Australia.

DAX

Country Specific Measure = CALCULATE(SUM(Sheet1[10th Marks]), Sheet1[Country]="Australia")

At the backend this works as

DAX

Country Specific Measure = CALCULATE(SUM(Sheet1[10th Marks]), 
FILTER(
ALL(Sheet1[Country]),
Sheet1[Country]="Australia")
) 

Here, the ALL function clears out the filter context on the specified column, and FILTER function is used to replace the entire filter with a new filter context.

CALCULATE dax function