Calculated columns in Power BI
A calculated column adds a column to a model table that DAX calculates row by row. It is the counterpart of a formula in an Excel table that fills all the way down.
In short: New column, then Name = expression. The formula calculates in every row with that row's values (row context), which is why columns appear without SUM. RELATED fetches values from a connected dimension.
Prerequisites: Date table.
Try it now
Row context
A measure calculates over many rows and therefore needs an aggregation such as SUM. A calculated column, in contrast, calculates once for every row of its table, and every row has exactly one value per column. That is why Sales[Amount] / Sales[Quantity] is right in a column but an error in a measure. This difference is called row context.
RELATED
In the current row, RELATED follows the relationship to the one side and fetches a value there: in the Sales table, for example, RELATED(Product[Price]). It only works in that direction. From the dimension there are many matching rows; that is what RELATEDTABLE is for (level 5).
One more exercise: days between two dates
Task How many days lie between order and shipping? Create the calculated column "Delivery Days" in Sales: the days from OrderDate to ShipDate.
Sales 120 rows, 7 columns
| OrderID | OrderDate | ShipDate | ProductID | RegionID | Quantity | Amount |
|---|---|---|---|---|---|---|
| 1 | 3 Oct 2026 | 6 Oct 2026 | 1 | 2 | 2 | 1798 |
| 2 | 9 Nov 2025 | 19 Nov 2025 | 2 | 3 | 5 | 1145 |
| 3 | 20 Sep 2026 | 27 Sep 2026 | 5 | 4 | 4 | 596 |
| 4 | 16 Jun 2025 | 2 Jul 2025 | 2 | 1 | 5 | 1145 |
| 5 | 26 Mar 2026 | 31 Mar 2026 | 1 | 3 | 4 | 3596 |
| 6 | 4 Dec 2025 | 10 Dec 2025 | 5 | 4 | 5 | 745 |
| 7 | 8 Jul 2025 | 26 Jul 2025 | 6 | 1 | 4 | 196 |
| 8 | 20 Feb 2025 | 1 Mar 2025 | 3 | 2 | 3 | 59.7 |
| 9 | 9 Dec 2025 | 24 Dec 2025 | 6 | 2 | 2 | 98 |
| 10 | 12 Aug 2026 | 25 Aug 2026 | 2 | 1 | 2 | 458 |
| 11 | 7 Sep 2026 | 12 Sep 2026 | 5 | 4 | 2 | 298 |
| 12 | 2 Mar 2026 | 14 Mar 2026 | 6 | 2 | 3 | 147 |
Showing the first 12 of 120 rows.
Measures: [Total Sales]
Product 6 rows, 4 columns
| ProductID | Product | Category | Price |
|---|---|---|---|
| 1 | Laptop | Hardware | 899 |
| 2 | Monitor | Hardware | 229 |
| 3 | Mouse | Accessories | 19.9 |
| 4 | Keyboard | Accessories | 39.9 |
| 5 | Office suite | Software | 149 |
| 6 | Antivirus | Software | 49 |
Region 4 rows, 2 columns
| RegionID | Region |
|---|---|
| 1 | North |
| 2 | South |
| 3 | West |
| 4 | East |
Date 730 rows, 4 columns
| Date | Year | Month | MonthName |
|---|---|---|---|
| 1 Jan 2025 | 2025 | 1 | Jan |
| 2 Jan 2025 | 2025 | 1 | Jan |
| 3 Jan 2025 | 2025 | 1 | Jan |
| 4 Jan 2025 | 2025 | 1 | Jan |
| 5 Jan 2025 | 2025 | 1 | Jan |
| 6 Jan 2025 | 2025 | 1 | Jan |
| 7 Jan 2025 | 2025 | 1 | Jan |
| 8 Jan 2025 | 2025 | 1 | Jan |
| 9 Jan 2025 | 2025 | 1 | Jan |
| 10 Jan 2025 | 2025 | 1 | Jan |
| 11 Jan 2025 | 2025 | 1 | Jan |
| 12 Jan 2025 | 2025 | 1 | Jan |
Showing the first 12 of 730 rows.
This exercise is part of Premium.
Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.
See Premium Already Premium? Log in
The first exercise in this lesson is free.
In real Power BI
- Pick the table: in the Data pane or in table view.
- New column: under Table tools or Modeling. The formula bar appears at the top.
- Enter the formula, Enter. Table view shows the new column with all its values.
Common mistakes
RELATED without a relationship
If the relationship is missing or points the other way, Power BI reports that the column does not exist in any related table. Check model view.
A column where a measure would do
Every calculated column is stored and makes the model bigger. If you only need a total in the report, a measure is better. More in the next lesson.
Column in Power Query or in DAX?
Anything that only needs values from the same row (dividing, splitting dates) can often be done in Power Query already. DAX columns pay off when they need values from other tables through relationships, as with RELATED.
Frequently asked questions
Does a calculated column recalculate with every filter?
No. It is calculated once when the data is loaded or refreshed. Filters in the report do not change it; that is the key difference from a measure.
Can I filter by a calculated column?
Yes, like any other column: in rows, on axes and in slicers.