top of page

SELECTCOLUMNS, ROW

  • Marek Vavrovic
  • Sep 14, 2021
  • 1 min read

Updated: Oct 5, 2021


ROW function.

Returns a table with a single row containing values that result from the expressions given to each column.


Syntax

ROW(<name>, <expression>[[,<name>, <expression>]…])


Parameters


Term Definition

name The name of the column, enclosed in double quotes.

expression Any DAX expression that returns a single scalar value to populate name.


Example 1:

This formula returns total number of points and number of countries.

ree

Example 2

with ADDCOLUMNS


ADDCOLUMNS(<table>, <name>, <expression>)


Row =

ADDCOLUMNS (

ROW (

"Points total", SUM ( tblTable[Points] ),

"Number of countries", DISTINCTCOUNT ( tblTable[Country] )

),

"Ratio", DIVIDE ( [Number of countries], [points total] )

)


ree

Example 3

with UNION


syntax

UNION(<table_expression1>, <table_expression2> [,<table_expression>]…)


ree


SELECTCOLUMNS


This function returns the selected columns from some source table.


Syntax:

SELECTCOLUMNS(<table>, <name>, <scalar_expression>)


Table manipulation functions are not supported for use in DirectQuery mode.

This function doesn't keep the source table columns

ree
SelectColumns Vs. AddColumns

One big difference of SelectColumns and AddColumns is that AddColumns keep all the existing columns in the table and adds more columns to that, But the SelectColumns starts with no columns from the table, and builds a custom subset of columns or with additional calculated columns on it.


ree




Comments


Subscribe Form

©2020 by MaVa Analytics. Proudly created with Wix.com

bottom of page