VAR: the DAX keyword that makes your measures readable
A DAX measure that repeats the same subtotal three times isn't thorough, it's a maintenance problem VAR was built to fix.
Tutorials, tips, and deep dives on DAX — every post from bianca.codes tagged DAX.
A DAX measure that repeats the same subtotal three times isn't thorough, it's a maintenance problem VAR was built to fix.
Three slicers and a card don't turn a spreadsheet into a data model, and the columns you didn't build are exactly where it falls apart.
The stakeholder emails asking whether the numbers are current stop the day you put the actual refresh time on the report - and a measure with NOW() is not how you do it.
Power Query carves one flat sales table into a fact and three dimensions, you build the relationships, and you prove the numbers didn't move - a restructure you can't validate is just hope.
A customer moves and changes tier, and some reports should show where they are now while others must show where they were at the sale - the gap is a modelling decision most tutorials skip.
Your measure is right, your data reconciles, and your year-to-date is still wrong - because the model never had a real date table, only a date column pretending to be one.
A dimension table isn't just a lookup. Why fact-to-dimension relationships have to be many-to-one, why bidirectional filtering always causes problems, and how to build dimensions your DAX can trust.
Most introductions to star schema start with the diagram. The star, the centre, the spokes. This one starts with the question: what problem does a fact table solve that a flat table doesn't? Part 1 builds the intuition before the vocabulary, so the rest of the series makes immediate sense.
MAP takes your LAMBDA and runs it on every element in an array. No helper columns, no dragging formulas, no VBA loops.
In a small team, you're the analyst, the engineer, the dashboard designer, and the person who explains what a p-value is at the all-hands.
The analysts who get traction aren't the fastest at pulling data, they're the best at unpacking what was actually being asked. The skill is asking good questions, and nobody trains for it.
Slow reports get blamed on complex measures. Complex measures get rewritten. And the report is still slow — because the actual problem is a flat table with 47 columns, many-to-many relationships, a…
BYROW hands your function an entire row at a time. BYCOL does the same by column. Together they replace an entire category of 'drag this formula down and keep it updated' work — and when you combin…
BYROW hands your function an entire row at a time — which means 'apply this logic to every row in this range' is one formula in one cell. No dragging, no CTRL+SHIFT+ENTER, no missing the last row w…
Most dashboards answer the question 'what happened?' Very few answer 'what should we do?' The gap isn't data — it's intent. A dashboard built for the former often actively gets in the way of the la…
SCAN hands you every intermediate result as it accumulates — which means a running total is one formula that spills down the column. No helper rows, no dragging, no breaking when someone inserts a …
SUMX, AVERAGEX, MAXX — these functions bring row context back into a measure, which sounds helpful until they don't behave the way you expect inside a CALCULATE. Part 4 closes the series with the p…
You'll build a named LAMBDA called OVERDUE that takes a date and a threshold and returns a clean status label. Then you'll call it in three different tables in the same workbook. By the end, you'll…
You delivered a clean model, a solid dashboard, a real solution — and got a blank look in the room. The work was right. But explaining technical work to someone who doesn't share your frame of refe…
Time intelligence functions look simple - TOTALYTD, SAMEPERIODLASTYEAR — until they aren't. The reason they break isn't the function. It's that context transition interacts with your date table…
Power Query is a brilliant transformation tool. Most of the M code in production is doing things that belong in DAX, SQL, or Python - and the models are slow and the code is unmaintainable.
CALCULATE is the most powerful function in DAX - and the most misunderstood. Once you see how it deliberately replaces the filter context rather than adding to it, every confusing measure result …
More charts don't mean more insight. Every visual you add is a question your stakeholder has to answer before they understand the point - and most reports ask them to answer fifteen questions bef…
You'll build a clean single-page report: KPI cards, a trend line, and one slicer. The kind that gets opened voluntarily, not just emailed as a screenshot. Starting from a blank canvas, ending with …
DAX's context confusion cost me hours. Turns out, it's just two simple ideas.