Cheat Sheets/Power BI/ADDCOLUMNS
DAX function

ADDCOLUMNSDAX 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

Related DAX functions

From Iterators & variables

Used in these tutorials

← Back to the Power BI (DAX) cheat sheet