DAX function
ADDCOLUMNS — DAX function reference
Add computed columns to a table.
Syntax
dax
ADDCOLUMNS(<table>, <name1>, <expression1> [, <name2>, <expression2>, …])
Examples
dax
ADDCOLUMNS(VALUES(Region[Name]), "Sales", [Total Sales])
→ A table
dax
ADDCOLUMNS(VALUES(Product[Category]), "Sales", [Total Sales], "Margin %", DIVIDE([Total Profit], [Total Sales]))
→ A virtual table with two computed columns per category
A common pattern to materialize a per-group aggregate before feeding it into another calculation, like a filter or another SUMX.
dax
SUMX(ADDCOLUMNS(VALUES(Sales[OrderID]), "OrderTotal", CALCULATE(SUM(Sales[Amount]))), [OrderTotal])
→ Sum of order totals, computed via an intermediate table
Common mistakes & gotchas
- Columns added by ADDCOLUMNS are computed in row context as the table is built, and any measure reference inside triggers context transition per row — this can be expensive on wide tables, so filter the base table argument first.
- A column added earlier in the same ADDCOLUMNS call is not directly referenceable by name in a later column expression at the same level — nest another ADDCOLUMNS or use VAR if you need to build on a prior computed column.
Related DAX functions
From Iterators & variables