Calculated columns
One stored value per row
A calculated column extends an existing model table with a value for each record. In an Import model, those values are computed during model processing and occupy model storage. A slicer changes which records are visible, not the values already computed for the records. Use the clean V007 Import model from labs/relationships/README.md with FactSales, DimProduct and DimRegion and active single-direction relationships. The five order lines are dated January 5–7, 2026; all amounts are USD. Quantity, price and cost are validated nonblank numbers. Use a disposable local copy and clear unrelated filters. Each formula belongs in the explicitly named editor, with English comma separators. All outputs are expected, not observed in Power BI; native DAX/M NOT RUN.
How a row supplies values
Row context means the expression has a current row. In a simple multiplication it can read Quantity and UnitPriceUSD from that row without summing the whole table. This differs from filter context, which restricts data for a calculation. Row context alone does not automatically filter an aggregation over a table. Later lessons cover context transition.
Example 1: calculate a line amount
Select FactSales and New column. Enter:
Line Amount Check = FactSales[Quantity] * FactSales[UnitPriceUSD]Format as USD with appropriate precision. L01 through L05 should yield 24, 30, 36, 50, 60 respectively. L03 remains 36 if South is selected. Add LineID and Line Amount Check to a table with no summarization for the numeric value when inspecting individual lines. Compare with existing RevenueUSD rather than replacing the canonical field. The five differences should be zero. If they are not, inspect unit prices, units and rounding policy before using the new column.
Example 2: a reusable grouping field
Create another New column on FactSales:
Line Size = IF(FactSales[Quantity] >= 2, "Multi-unit", "Single-unit")The threshold is a fictional business rule. L01, L03 and L05 are Multi-unit; L02 and L04 are Single-unit. Use Line Size as a slicer; with the Chapter 09 [Total Revenue] measure the group totals should be 120 and 80 USD. Selecting Multi-unit leaves three matching rows; their labels are unchanged. This is a line-level label, not an order-level label: O01 has two lines in different groups.
Choose source, M or DAX deliberately
If a line amount is a shared data contract, compute or validate it upstream where possible. In Power Query, a Custom Column expression [Quantity] * [UnitPriceUSD] could create the same field before loading. Set its type and reconcile the result. DAX is useful when a row-level attribute needs model relationships or cannot be prepared upstream. A redundant imported DAX column adds processing and potential memory cost; compression depends on distinct values and distribution. Neither approach is always faster. Keep temporary diagnostic columns out of the final shared model if unnecessary. DirectQuery and composite models have different support and evaluation constraints; this lab is Import only.
Practice
Complete worksheet task 1: calculate all five line amounts and explain why filtering does not recalculate a persisted value. Compare the line-size labels at the correct grain.
Official reading
options · columns · context · directquery. Documentation checked; exact installed build and native execution pending.