ROW DAX Function (Table manipulation)

Returns a single row table with new columns specified by the DAX expressions.

Syntax

ROW ( <Name>, <Expression> [, <Name>, <Expression> [, … ] ] )
Parameter Attributes Description
Name Repeatable

Name of the new column.

Expression Repeatable

The expression for the column.

Return values

Table An entire table or a table with one or more columns.

A single row table.

Remarks

ROW does not preserve the data lineage of the returned columns returned, even though a column expression is a simple column reference.

» 1 related article

Examples

--  ROW generates a table with one row only.
--  You provide the name of the columns and their values.
EVALUATE
    ROW ( 
        "Sales in 2009", CALCULATE ( [Sales Amount], 'Date'[Calendar Year] = "CY 2009" ),
        "Sales in 2008", CALCULATE ( [Sales Amount], 'Date'[Calendar Year] = "CY 2008" )
    )
Sales in 2009 Sales in 2008
9,353,814.87 9,927,582.99
--  Expressions evaluated in ROW respect the filter context.
EVALUATE
CALCULATETABLE (
    ROW (
        "Sales in 2009", CALCULATE ( [Sales Amount], 'Date'[Calendar Year] = "CY 2009" ),
        "Sales in 2008", CALCULATE ( [Sales Amount], 'Date'[Calendar Year] = "CY 2008" )
    ),
    'Product'[Brand] = "Contoso"
)
Sales in 2009 Sales in 2008
2,253,412.80 2,369,167.68
--  ROW controls the name of the columns, whereas the table constructor
--  automatically assigns column names. You must use SELECTCOLUMNS to control
--  the column names of a table constructor as you do in ROW.
DEFINE
    VAR Sales_2009_2008 =
        {
             ( CALCULATE ( [Sales Amount], 'Date'[Calendar Year] = "CY 2009" ), CALCULATE ( [Sales Amount], 'Date'[Calendar Year] = "CY 2008" ) )
        }
    VAR RenamedColumns =
        SELECTCOLUMNS (
            Sales_2009_2008,
            "Sales in 2009", [Value1],
            "Sales in 2008", [Value2]
        )

EVALUATE
Sales_2009_2008

EVALUATE
RenamedColumns
Value1 Value2
9,353,814.87 9,927,582.99
Sales in 2009 Sales in 2008
9,353,814.87 9,927,582.99

Related articles

Learn more about ROW in the following articles:

Last update: Jul 24, 2021   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://docs.microsoft.com/en-us/dax/row-function-dax

2018-2021 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of ROW? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.