DAX Aggregation SELECTCOLUMNS function



Description

Adds calculated columns to the given table or table expression. DAX SELECTCOLUMNS function is new in Excel 2016.

Syntax

SELECTCOLUMNS (<table>, <name>, <scalar_expression>, [<name>, <scalar_expression>] …) 

Parameters

Sr.No. Parameter & Description
1

table

Table or a DAX expression that returns a table.

2

name

The name given to the column, enclosed in double quotes.

3

scalar_expression

DAX expression that returns a scalar value like a column reference, integer or string value.

Return Value

A table with the same number of rows as the table specified as the first parameter. The returned table has one column for each pair of name and scalar_expression parameters. Each scalar_expression is evaluated in the context of a row from the specified table parameter.

Remarks

SELECTCOLUMNS is similar to ADDCOLUMNS, and has the same behavior except that instead of starting with the table specified, SELECTCOLUMNS start with an empty table before adding columns.

Example

= SELECTCOLUMNS ( 
   Products,"Product-NoOfUnits",Products[Product]&" - "&Products[Units Sold])
dax_functions_aggregation.htm
Advertisements