ADDCOLUMNS Function (DAX)

How does the ADDCOLUMNS function (DAX) work?

The ADDCOLUMNS function (DAX) is an aggregation function used to add columns to DAX tables. It adds calculated columns to any given table or table expression. This function will return a table with all its original columns and the added ones.

ADDCOLUMNS Formula Syntax

ADDCOLUMNS(
     <table>, <name>, <expression> [, <name>, <expression>]….
)

How do you use the ADDCOLUMNS function?

This function is equivalent to adding a calculated column to a table; the only real difference is that ad hoc columns are calculated only once (they’re not stored in your model). 

Related Blog Posts

Related Support Forum Posts

Summarize not showing all data
ADDCOLUMNS. Getting Blanks
Why ADDCOLUMNS command doesn’t work in PowerBI desktop

Considerations when using the ADDCOLUMNS function

The ADDCOLUMNS has 3 parameters to work with: the table to which the new columns are added, the name given to the new column and is enclosed in double-quotes, and the expression that returns a scalar expression which is evaluated for every row of the table.  

Related Video Tutorials

Formula examples using the ADDCOLUMNS function

= ADDCOLUMNS ( Products,”East_Sales”,
      SUMX (RELATEDTABLE (East_Sales),
      IF([Product] = East_Sales[Product], East_Sales[Sales Amount],0)
      )
)

= EVALUATE
ADDCOLUMNS (
    Species,
    “Number transactions”,
    COUNTROWS ( RELATEDTABLE ( ‘Transaction’ ) )
)

= ADDCOLUMNS (
    Products,”East_Sales”,
    SUMX (RELATEDTABLE(East_Sales),
       IF([Product] = East_Sales[Product], East_Sales[Sales Amount],0)
)

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.