Advanced Excel · Intermediate level

Intermediate level · Module 2: Data Models and Power Pivot · Lesson 3 of 3

DAX Measures

Write DAX measures that calculate correctly in any PivotTable context.

In this lesson you will

  • Write basic DAX measures
  • Use CALCULATE and simple time comparisons

Key concepts

measurefilter contextCALCULATEDIVIDE

The lesson

A measure is a calculation defined once and used everywhere: Total Value := SUM(Distributions[Value]). It recalculates for every row, column and slicer selection — the filter context.

CALCULATE changes the filter context: Juba Value := CALCULATE([Total Value], Locations[County] = "Juba"). DIVIDE handles division by zero safely.

Build complex measures from simple ones, name them clearly and check results against an independent calculation.

Step by step

  1. Write Total Value and Total Quantity measures.
  2. Write an average value per household measure with DIVIDE.
  3. Write a measure for one county with CALCULATE.
  4. Write last month's value and month-on-month change.

Practice activity

Write and check the five measures for the NGO model.

Expected result: Five measures that match independent checks in every context tested.

Check your understanding

  1. What is filter context?

    Show answer

    The filters applied by rows, columns and slicers when a measure is calculated.

  2. Why use DIVIDE instead of /?

    Show answer

    It handles division by zero safely.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.