Skip to content

Chapter 1 of 6

Foundations of DAX and Calculation Types

DAX, or Data Analysis Expressions, is the formula language used in Power BI to create custom calculations. The two principal calculation objects in Power BI are measures and calculated columns, and understanding their differences is essential for writing effective DAX. A measure is a DAX formula evaluated at query time based on the filter context generated by slicers, visuals, and report filters. Because measures are recalculated each time the user interacts with a report, they return dynamic values that respond to the surrounding context. By contrast, a calculated column is evaluated row by row at refresh time and stored in the model, where it consumes memory and is not affected by user selections. While calculated columns are useful for adding static attributes to a table, measures are generally preferred for aggregations, ratios, and time intelligence because they do not inflate model size.

DAX also supports calculated tables, which are entire tables built from DAX expressions such as FILTER, UNION, SUMMARIZE, or GENERATE. Calculated tables are recomputed on refresh and stored in memory. Power BI additionally offers implicit measures, which are auto-generated aggregations like SUM, COUNT, or AVERAGE created when a numeric column is dragged into a visual. These cannot be reused or customized, so explicit DAX measures are recommended for any non-trivial analysis.

Two contexts govern every DAX evaluation: row context and filter context. Row context means the formula is aware of the current row being iterated, such as inside a calculated column or an iterator like SUMX. Row context alone does not perform filtering, but it can be converted into filter context through a mechanism called context transition, which typically occurs inside CALCULATE. Filter context is the set of active filters on the data model at evaluation time, originating from slicers, visuals, drillthrough actions, or DAX expressions. Mastering the interaction between these two contexts is the foundation for writing DAX that performs predictably.

All chapters
  1. 1Foundations of DAX and Calculation Types
  2. 2CALCULATE and Filter Manipulation
  3. 3Iterator, Aggregation, and Lookup Functions
  4. 4Time Intelligence and Date Tables
  5. 5Data Modeling, Relationships, and Schemas
  6. 6Performance, Storage Modes, and Security

Drill it

Reading is not remembering. These come from the Power Bi Dax Fundamentals deck:

Q

What is a DAX measure?

A calculated formula created using DAX that is evaluated at query time based on filter context. Measures return dynamic values depending on the filters applied...

Q

How does filter context work in DAX?

Filter context is the set of filters applied to a calculation, generated by slicers, visuals, page-level filters, or row-level security. It determines which row...

Q

What does the CALCULATE function do?

CALCULATE evaluates an expression in a modified filter context. It can add, replace, or remove filters on specified columns, overriding the existing filter cont...

Q

What is the syntax for CALCULATE?

CALCULATE(, , , ...). The expression is evaluated after applying all listed filter arguments, which can be boolean expressions, table expressions, or KEEPFILTER...