Articles

DAX for People Who Are Not Data Engineers

DAX has a reputation for being hard. It is not hard - it is different. The concepts that trip people up are not the calculations themselves, they are the mental model of how DAX evaluates expressions.

The key concept: filter context

In Excel, a formula runs in the context of a single cell. In DAX, every calculation runs in the context of whatever filters are applied - by the report page, by slicers, by the row in a table. Understanding filter context is 80 percent of understanding DAX.

The five functions that cover most use cases

CALCULATE is the most important function in DAX. It evaluates an expression inside a modified filter context. Almost everything interesting in DAX involves CALCULATE.

SUM, SUMX, AVERAGE, AVERAGEX - the X versions iterate over a table and evaluate an expression row by row. Use them when you need to calculate something per row before aggregating.

DIVIDE is how you handle division without crashing your report when the denominator is zero.

RELATED lets you pull a value from a related table in your data model - the DAX equivalent of a VLOOKUP that works automatically across relationships.

CALCULATE with DATESINPERIOD or SAMEPERIODLASTYEAR handles most time intelligence requirements.

The mistake to avoid

Do not write complex measures before your data model is right. DAX is powerful precisely because a well-structured model makes even complex calculations straightforward. If your measures are getting complicated, the problem is usually the model, not the formula.


If you want to get more out of your Power BI investment, the fastest path is usually improving the data model and measure structure rather than adding more visuals. That is the work we do with most BI clients.

Have a question about this topic? We work with businesses worldwide.

Get in Touch