Blog / Power BI

DAX measures that read like sentences

Measures are read far more often than they are written. Naming and structure that let the next analyst follow the logic without a decoder ring.

A DAX measure is written once and read for years, usually by someone who was not in the room when it was written. Most measures are optimised for the moment of writing: terse, clever, unreadable a month later. The measures that survive are the ones that read like a sentence.

Name for the reader

Measure 2 and Sum of Amount 1 are confessions, not names. A good measure name says what it returns and in what unit: Repairs Completed (MTD), Arrears Balance, No-Access Rate %. The name is the first line of documentation and the one everyone sees.

Use variables as steps

Variables are not just a performance tool; they are how you show your working. Each VAR is a named step, so the logic reads top to bottom like a paragraph, and it is far easier to follow and to debug when something looks wrong.

DAX measure
No Access Rate % =
VAR Appointments = COUNTROWS( Appointment )
VAR NoAccess =
    CALCULATE(
        COUNTROWS( Appointment ),
        Appointment[Outcome] = "No access"
    )
RETURN
    DIVIDE( NoAccess, Appointments )

Anyone can read that, top to bottom, and say what it does. Compare it to the same logic nested into a single DIVIDE with two CALCULATEs inline, and you see the difference between code that works and code that lasts.

Always DIVIDE, never slash

Small disciplines compound. Use DIVIDE for safe division so a zero denominator gives a blank, not an error. Keep one measure to one idea. Comment the genuinely non-obvious. The goal is that the next analyst changes the measure confidently, because they can read it.

The BaseData take
1 Name measures for what they return and the unit. The name is documentation.
2 Use variables as named steps so the measure reads in order.
3 Use DIVIDE, keep one idea per measure, and comment only the surprising parts.

Write every measure for the analyst who inherits it. Often, that analyst is you, a year from now.

Power BIDAXModellingCraft
Get in touch

Let's make your housing data make sense.

Tell us where your reporting hurts. We'll tell you, plainly, whether we can help and how we'd approach it.