Page 57 - DAX-Formula-Reference-Guide-Enterprise-DNA_Neat
P. 57

DAX Formulas Reference Guide  |  Statistical Functions (DAX)



                Example:
                The following calculated column in the Products table calculates the sales ranking for
                each product in the Internet channel.


                =RANKX(ALL(Products),SUMX(RELATEDTABLE(InternetSales),[SalesAmount]))

                ROW Function (DAX)
                Returns a table with a single row containing values that result from the expressions given
                to each column.


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


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

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



                Example:
                The following example returns a single row table with the total sales for internet and
                resellers channels.

                ROW(“InternetTotalSales(USD)”,SUM(InternetSales_USD[SalesAmount_USD]),”ResellersT
                otalSales(USD)”,SUM(ResellerSales_USD[SalesAmount_USD]))


                SELECTCOLUMNS Function (DAX)
                Adds calculated columns to the given table or table expression.

                Syntax: SELECTCOLUMNS(<table>,<name>,<scalar_expression>[,<name>,<scalar_
                expression>]…)



                Parameter                    Definition
                table                        Any DAX expression that returns a table.

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

                expression                   Any 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 argument. The
                returned table has one column for each pair of <name>, <scalar_expression> arguments,
                and each expression is evaluated in the context of a row from the specified <table>
                argument.

                Example:
                SELECTCOLUMNS(Info,”StateCountry”,[State]&”,”&[Country])





                +64 21 164 5508  |  info@enterprisedna.co  57
   52   53   54   55   56   57   58   59   60   61