Back to Blog

Column and Measure References in DAX - The Convention That Saves Your Future Self

May 9, 20267 min readMichael Ridland

There is a small DAX convention that separates the models I enjoy inheriting from the ones I dread opening. It has nothing to do with star schemas, calculation groups, or any of the things people argue about on LinkedIn. It is the way you reference columns and measures inside your DAX formulas. Get this right and your model is readable years later. Get it wrong and every formula becomes a small puzzle.

I want to spend a post on this because Microsoft put it in their official DAX best practices and almost no analyst I meet follows it.

The rule, plain and simple

Always fully qualify column references. Never fully qualify measure references.

That is it. A column should be written as 'Table Name'[Column Name] even when the formula is being written inside that table or in a context where the column would resolve without the table name. A measure should be written as [Measure Name] with no table prefix.

It looks like a small stylistic choice. It is not. It is the single biggest readability win you can apply to a DAX codebase, and once you have lived with both conventions you will never go back.

Why this works

The reasoning is simple. When you read a DAX formula six months after you wrote it, you need to instantly know two things about every identifier - is this a column or a measure, and if it is a column, which table does it live in. The convention answers both questions visually without you having to think.

Sales[Quantity] is obviously a column on the Sales table. [Total Revenue] is obviously a measure.

If you see [Quantity] on its own with no table, your eye has to stop and figure out whether that is a measure or an unqualified column reference. You have to remember whether the formula context guarantees the reference will resolve, or whether the DAX engine is doing some implicit lookup that might break later. That is mental tax on every read of every formula. It compounds across thousands of lines of DAX in a real model.

We see this constantly when we audit Power BI models for clients. A team will have built a working report but the DAX is a slurry of bare column references and table-prefixed measure references, which is exactly the inverse of the convention. The model works. Refreshes succeed. The numbers are correct. But nobody on the team can confidently change anything because reading the formulas is slow and error prone.

Why measures should not be prefixed

Here is the bit that catches people out. Measures live in tables in the Power BI metadata model. You can technically write Sales[Total Revenue] and DAX will accept it. Some IntelliSense implementations even suggest the table prefix. Microsoft explicitly recommends against this.

The reason is that measures are first class objects in the model. They are not tied to the table they live in. You can move a measure from one table to another without changing its meaning. The table assignment is purely organisational - many serious modellers create a hidden "Measures" table just to hold all measures in one place. If you have been prefixing your measures with their host table, every move breaks every reference, and you have to refactor.

If you never prefix measures, moves are free. Reorganise your measure folders. Move a measure into a measure table for tidiness. Nothing breaks. This is the kind of small architectural flexibility that matters when models grow.

Why columns should always be prefixed

Columns are different. A column has a real, permanent identity attached to its table. Sales[Quantity] and Inventory[Quantity] are different columns that happen to share a name. If you write [Quantity] in a formula and DAX has to figure out which one you mean, you are leaving things to chance.

DAX has rules for resolving unqualified column references. Inside a row context on the Sales table, [Quantity] will resolve to Sales[Quantity]. Inside a CALCULATE filter it might not resolve at all. Inside a calculated column on Inventory it will resolve to Inventory[Quantity]. The rules are not crazy but they are non-trivial, and if your formula gets moved, copied, or refactored later the unqualified reference might suddenly resolve to a different column or stop resolving at all.

Always qualifying column references means the formula does what it says, regardless of context. It is verbose. It is also reliable, and DAX needs reliability more than it needs brevity.

What this looks like in practice

A measure following the convention reads like English:

Total Revenue =
SUMX (
    Sales,
    Sales[Quantity] * Sales[Unit Price]
)

Profit Margin =
DIVIDE ( [Total Revenue] - [Total Cost], [Total Revenue] )

You can scan that and immediately see that Total Revenue iterates over the Sales table multiplying two columns from Sales, and Profit Margin calls two other measures. Nothing requires interpretation. The structure is self documenting.

Compare it to the same thing written without the convention:

Total Revenue =
SUMX (
    Sales,
    [Quantity] * [Unit Price]
)

Profit Margin =
DIVIDE ( Revenue[Total Revenue] - Revenue[Total Cost], Revenue[Total Revenue] )

The second version looks plausible but it is worse on every dimension. The columns in the first formula could be referring to anything in the row context. The measures in the second formula are tied to a Revenue table that might get reorganised next month.

What we tell new consultants

When we onboard new analysts and consultants into Power BI work, this is one of the first things we drill in. We have a coding standard document that says the rule in one sentence and gives a few examples. Every model review checks for it. Pull requests get rejected if the convention is violated.

This sounds heavy handed for what looks like a stylistic preference. The reason we are this strict about it is that DAX has very few syntactic safety nets. The language does not have types in the way Python or TypeScript do. It does not have an obvious distinction between functions, variables, and references. The compiler is forgiving. If you do not impose discipline at the convention level, the codebase will rot.

The good news is that once a team adopts this consistently, the payoff is immediate. Code reviews speed up. Bugs caused by ambiguous references disappear. Models get easier to inherit. We have helped a few enterprise customers retrofit this convention across hundreds of existing measures, and the effort pays back within months because every subsequent change is faster.

Tools that help

DAX Studio shows formulas exactly as they are stored, which is helpful for spotting violations across a whole model in one go. Tabular Editor lets you write scripts that scan every measure and flag ones that contain unqualified column references or table-prefixed measure references. We use a Tabular Editor script for periodic hygiene passes on client models, and we have shared variations of it across teams in our Microsoft data consulting practice.

The other tool worth mentioning is Best Practice Analyzer rules. There is a popular community ruleset for Power BI and Tabular Editor that includes a rule for exactly this convention. Enable it. Run it. Fix the violations. It is one of those small investments that compounds for years.

The honest assessment

I have heard people argue that this convention is too verbose, that bare column references look cleaner, that the rule is fussy. The people making these arguments have almost always been building small models that they personally own. The convention does not feel valuable when you are the only person who will ever read the code and the model only has eight measures in it.

The value shows up when your model grows past about fifty measures, or when more than one person edits it, or when you come back to it a year later. At that point bare column references and prefixed measures become a small but constant tax on every interaction with the code.

If you are an Australian business running Power BI seriously, this is the kind of thing your standards document should cover. It costs nothing to adopt and it pays back forever. Our team works with organisations across Sydney, Brisbane, and Melbourne to professionalise their Power BI and Microsoft Fabric estates, and these small conventions are always part of the conversation. If your DAX has become a maintenance burden and you want a hand cleaning it up, come and have a chat.

Reference - DAX - Column and measure references (Microsoft Learn)