SELECTCOLUMNS DAX Function (Table manipulation)
Returns a table with selected columns from the table and new columns specified by the DAX expressions.
Syntax
Parameter | Attributes | Description |
---|---|---|
Table Iterator |
The table from which columns are selected. |
|
Name | Repeatable |
The name of the new column to be added. |
Expression Row Context |
Repeatable |
The expression for the new column to be added. |
Return values
A table with the same number of rows as the table specified as the first argument. The returned table has one column for each pair of Name, Expression arguments, and each expression is evaluated in the context of a row from the specified Table argument.
Remarks
SELECTCOLUMNS has the same signature as ADDCOLUMNS, and has the same behavior except that instead of starting with the <Table> specified, SELECTCOLUMNS starts with an empty table before adding columns.
SELECTCOLUMNS keep the data lineage of the columns assigned to a simple column reference. Any different expression breaks the data lineage.
Related articles
Learn more about SELECTCOLUMNS in the following articles:
-
Using GENERATE and ROW instead of ADDCOLUMNS in DAX
This article explains how to improve DAX queries using GENERATE and ROW instead of ADDCOLUMNS when you create table expressions. » Read more
-
Querying raw data to Tabular
This article describes how to extract raw data stored in the Tabular engine, used by Analysis Service Tabular, Power BI, and Power Pivot. » Read more
-
From SQL to DAX: Projection
This article describes projection functions and techniques in DAX, showing the differences between SELECTCOLUMNS, ADDCOLUMNS, and SUMMARIZE. » Read more
Related functions
Other related functions are:
Last update: Feb 25, 2021 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
MSDN documentation: https://docs.microsoft.com/en-us/dax/selectcolumns-function-dax