DAX function
CALCULATE — DAX function reference
Evaluate with modified filters.
Syntax
dax
CALCULATE(<expression>, <filter1>, <filter2>, …)
Examples
dax
CALCULATE(SUM(Sales[Amount]), Sales[Region] = "West")
→ A number
The classic percent-of-total pattern: CALCULATE with ALL() clears filters to get the denominator.
dax
VAR RegionSales = SUM(Sales[Amount]) VAR TotalSales = CALCULATE(SUM(Sales[Amount]), ALL(Sales)) RETURN DIVIDE(RegionSales, TotalSales)
→ This region's share of the grand total
Multiple filter arguments are combined with an implicit AND.
dax
CALCULATE(SUM(Sales[Amount]), Sales[Region] = "West", Sales[Year] = 2026)
→ West region, 2026 only
Common mistakes & gotchas
- The single most important function in DAX. Filter arguments override matching filters from the visual.
- A boolean filter argument like Sales[Region] = "West" replaces any existing filter on that column from slicers or the visual — it does not intersect with it. Use KEEPFILTERS to intersect instead of override.
- CALCULATE is what triggers context transition: wrapping an expression in CALCULATE inside a calculated column or an iterator (like SUMX) turns the current row into an equivalent filter, which is why the same measure can return different numbers on a card versus inside SUMX.
Related DAX functions
From Filter context