OneLake shortcuts: use your data in Fabric without copying it
What OneLake shortcuts are, which sources they can point to, and when a shortcut beats copying data into Microsoft Fabric for your business.
Sooner or later, everyone learning Power BI writes their first DAX formula and hits the same fork in the road. Should this be a calculated column or a measure? Both use DAX, both appear in the Data pane, and both can produce a number on a report. Yet they behave very differently, and picking the wrong one is one of the most common reasons a beginner's totals look strange.
This guide explains what each one is, how they differ, and a simple way to decide which to use.
Microsoft's own tutorial puts it neatly: measures usually go in a visual's Values area, while calculated columns are used as new fields in the rows, axes, legends and group areas of visuals.
A calculated column is a new column you add to an existing table, with a DAX formula that defines its value. The formula is evaluated once for each row, using what DAX calls row context: you can think of it as "the current row".
Here is a simple example on a Sales table:
Order Size =
IF ( Sales[Quantity] >= 10, "Bulk", "Standard" )
Each row gets the label "Bulk" or "Standard", and you can now use Order Size in a slicer or on a chart axis.
The most important thing to understand is when the work happens. According to Microsoft's DAX documentation, calculated column values are computed and stored in the model. They are only recalculated when the table, or a related table, is refreshed, or when the model is reloaded (for example, when you close and reopen the file). They do not react to slicers or filters on the report page.
A calculated column can also look up a value from a related table using RELATED, as long as a relationship exists:
Customer Region =
RELATED ( Customer[Region] )
A measure is a named formula that aggregates data. Its result is not stored row by row. Instead, it is worked out at query time, whenever someone opens a report or interacts with a visual.
Total Sales =
SUMX ( Sales, Sales[Quantity] * Sales[Unit Price] )
SUMX returns the sum of an expression evaluated for each row of a table, so this measure multiplies quantity by unit price row by row and then adds the results up.
Drop Total Sales into a table visual next to Customer Region and it shows the right figure for each region. Add a year slicer and every number updates. That responsiveness comes from filter context: the filters, rows, columns and slicers that apply to each cell of a visual. As Microsoft's documentation puts it, a measure's result cannot be determined without context.
Measures can also reference other measures, which makes them easy to build in layers:
Average Order Value =
DIVIDE ( [Total Sales], DISTINCTCOUNT ( Sales[Order ID] ) )
| Calculated column | Measure | |
|---|---|---|
| Calculated | At refresh, for every row | At query time, for each cell in a visual |
| Stored in the model | Yes, adds to model size | No, only the formula is stored |
| Reacts to slicers and filters | No | Yes |
| Typical use | Slicers, filters, axes, grouping | Totals, ratios, KPIs, comparisons |
| Context it starts with | Row context | Filter context |
Imagine you want a profit margin. A tempting first attempt is a calculated column:
Margin % =
DIVIDE ( Sales[Profit], Sales[Sales Amount] )
That gives a correct margin for each individual row. The problem appears in a visual. Put Margin % in a table and Power BI will aggregate the column, by default with a sum, so you get percentages added together. Switch it to average and you get the average of the row margins, which is not the same as overall margin: a small order with a high margin counts just as much as a large order with a low one.
The correct approach is a measure that divides the totals:
Margin % =
DIVIDE ( SUM ( Sales[Profit] ), SUM ( Sales[Sales Amount] ) )
Now every cell, subtotal and grand total is calculated from the summed figures in its own filter context, so the numbers add up the way the business expects. As a rule, ratios, percentages and averages almost always belong in measures.
A note on DIVIDE: Microsoft recommends it over the / operator when the denominator could be zero or blank. If it is, DIVIDE returns BLANK instead of an error, and visuals hide blank results by default. When you are dividing by a constant, the / operator is fine.
When you drag a numeric column straight into a visual, Power BI summarises it for you, usually with a sum. Microsoft calls this an implicit measure. It is handy for quick exploration, but it has drawbacks:
Creating an explicit measure with New measure (on the Home tab, or by right-clicking a table) gives the calculation a name, one definition and a single place to fix it. Many teams then hide the raw numeric columns so report builders use the measures instead.
Calculated columns are not wrong, but they are not always the best home for row-level logic. Microsoft's guidance on reducing model size points out that calculated columns typically compress less efficiently than columns created in Power Query, and they are built only after all the Power Query tables have loaded, which can lengthen refresh times.
The recommendation is to prefer custom columns in Power Query where possible, or to calculate the value in the source database itself. A calculated column is still the better choice when the formula needs to evaluate measures or relies on DAX-only functionality.
A practical order of preference for a new row-level value is:
Ask yourself these questions when you write a new formula:
Calculated columns describe each row and are fixed at refresh time. Measures summarise many rows and respond to every filter, slicer and visual. Use columns for things you want to slice by and measures for things you want to see the value of. Get that one distinction right, and most of the "why is my total wrong?" moments in Power BI disappear.
Free every Friday
Join our free live class every Friday at 6pm UK time: hands-on lessons, live Q&A and career tips from a working Senior Data Analyst.
Keep reading
What OneLake shortcuts are, which sources they can point to, and when a shortcut beats copying data into Microsoft Fabric for your business.
Why every new Power BI report shouldn't bring its own copy of the data, and how a shared semantic model gives your business one version of the numbers.
SQL reads your query in a different order from the one you type. Learn that order and you'll understand alias errors, WHERE vs HAVING and where LIMIT really applies.
The Data Brief
New guides on Power BI, Fabric and SQL, plus class and cohort dates first. Free, and you can unsubscribe any time.