- DAX Functions Tutorial
- DAX Functions - Home
- DAX Functions - Introduction
- DAX Parameter Naming Conventions
- Description Structure
- DAX Functions - Aggregation
- DAX Functions - Filter
- DAX Functions - Time Intelligence
- DAX Functions - Date and Time
- DAX Functions - Information
- DAX Functions - Logical
- Math & Trigonometric Functions
- DAX Functions - Parent & Child
- DAX Functions - Statistical
- DAX Functions - Text
- DAX Functions - Other
- DAX Functions Useful Resources
- DAX Functions - Quick Guide
- DAX Functions - Useful Resources
- DAX Functions - Discussion
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])