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

DAX Formulas Reference Guide  |  Statistical Functions (DAX)



                COUNTA Function (DAX)
                The COUNTA function counts the number of cells in a column that are not empty. It counts
                not just rows that contain numeric values, but also rows that contain non-blank values,
                including text, dates, and logical values.

                Syntax: COUNTA(<column>)



                Parameter                    Definition
                column                       The column that contains the values to be counted.



                Return Value:
                A whole number.


                Example:
                The following example returns all rows in the Reseller table that have any kind of value
                in the column that stores phone numbers. Because the table name does not contain any
                spaces, the quotation marks are optional.

                =COUNTA(‘Reseller’[Phone])


                COUNTAX Function (DAX)
                The COUNTAX function counts non-blank results when evaluating the result of an
                expression over a table. That is, it works just like the COUNTA function, but is used to
                iterate through the rows in a table and count rows where the specified expressions
                results in a non-blank result.

                Syntax: COUNTAX(<table>,<expression>)



                Parameter                    Definition
                table                        The table containing the rows for which the expression will be evaluated.

                expression                   The expression to be evaluated for each row of the table.



                Return Value:
                A whole number.


                Example:
                The following example counts the number of non-blank rows in the column, Phone, using
                the table that results from filtering the Reseller table on [Status] = Active.

                =COUNTAX(FILTER(‘Reseller’,[Status]=”Active”),[Phone])














                +64 21 164 5508  |  info@enterprisedna.co  50
   45   46   47   48   49   50   51   52   53   54   55