Write context-aware DAX measures — Smart Study Module 15

The same measure must answer company, branch and month questions without hardcoded totals.

Outcomes

Understand

A measure evaluates in filter context at query time. A calculated column computes a value for each stored row and is not a dynamic substitute for an aggregate KPI.

Collection = SUM(Payments[amount]) and Target = SUM(Targets[amount]) respond to their relationships. Efficiency = DIVIDE([Collection],[Target]) yields BLANK by default when the denominator is zero.

CALCULATE evaluates an expression under modified filter context. A measure for 90+ POS should operate on Loans, not Payments. A ratio that ignores all filters is a different business definition and must be labeled.

Follow along

  1. Create Collection and Target as measures.
  2. Create Efficiency with DIVIDE.
  3. Select January and Nashik to verify 70%.
  4. Create DPD90 POS and verify the January-end snapshot is ₹500,000.

Worked example

Target = SUM(Targets[amount])
Efficiency = DIVIDE([Collection], [Target])
DPD90 POS = CALCULATE(SUM(Loans[pos]), Loans[dpd] >= 90)

January Efficiency=80%; Nashik January=70%; DPD90 POS=500000.

Practice

Enter Nashik January Efficiency as a percentage number.

Create a free personalized study plan · Download project instructions

Interactive practice runs in your browser.