| AVERAGE | AVERAGEA | AVERAGEX |
| COUNT | COUNTA | COUNTX | COUNTROWS | COUNTBLANK |
| DISTINCTCOUNT |
| SUM | SUMX |
| MAX | MAXX |
| MIN | MINX |
You can compute the Aggregateof one column, but cannot compute aggregate of an expression
Iterator functions can compute aggregate of expression
Aggregation function returns a Scalar value to a column or an expression evaluated by iterating a table expression.
- Return the
Arithmetic Meanof the values in the column. - Return a
Scalarvalue ofCurrencyorDecimaltype.
AVERAGE ( 'Table'[Column] )
- Similar to
AVERAGE, handles non numeric data. AVERAGEAmanages aBOOLEANdata type as an integer (FALSE:0&TRUE:1)AVERAGEAalways considers aSTRINGas0, regardless of the content of the string.
AVERAGEfunction internally executesAVERAGEX, without any performance difference.AVERAGEXignoresBLANK()AVERAGEXconsiders0
AVERAGEX (
Table,
Table[Column]
)
If the Column Values are String
AVERAGEX (
Table,
VALUE ( Table[Column] )
)
- Counts the number of
Rowsin the table. COUNTdoes not countBLANK()rows, but it countsemptystrings.
COUNT ( Table[Column] )
- Similar to
COUNT, can operate on aBOOLEANdata type.
- Count the number of values which result from evaluating an expression for each row of a table.
- The
COUNTfunction internally executesCOUNTX, without any performance difference. - When function finds no rows it returns
Blank
COUNTX (
Table, // Table
Table[Column] // Expression
)
- Counts the number of
Rowsin the table includingblankrows. - We can use
CALCULATEwithCOUNTROWSto ignoreBLANK()andEmptystring.
CALCULATE (
COUNTROWS ( Table ),
NOT ISBLANK ( Table[Column] ) && Table[Column] <> "" // Ignore rows with BLANK() and Empty string values.
)
Count the DISTINCT rows in the table
COUNTROWS ( DISTINCT ( Table ) ) or DISTINCTCOUNT ( Table[Column] )
Count whether a column has only one value.
COUNTROWS ( VALUES ( table[column] ) ) = 1 or HASONEVALUE ( table[column] ) )
- Counts the number of
BLANK()rows in the column. - It returns
BLANK(), if there are no rows. Emptystring is considered as aBLANK()forCOUNTBLANK
COUNTBLANK ( Table[Column] )
Equivalent faster expression for counting Blank rows.
CALCULATE (
COUNTROWS ( Table ),
KEEPFILTERS ( ISBLANK ( Table[Column] ) )
)
Equivalent faster expression for counting rows with Empty strings.
CALCULATE (
COUNTROWS ( Table ),
KEEPFILTERS ( Table[Value] = "" )
)
- Returns a single column table of
UniqueValues. - Does not return the
Blankrow.
- Returns a single column table of
UniqueValues. - Similar to
DISTINCTbut also have additionalBlankrows for the values which is not found. SUMaccepts only one column, does not supportExpression
- Add all the numbers in the column.
SUMfunction internally executesSUMX, without any performance difference.
SUM ( Table[Column] )
What actually happens internally
SUMX (
Table,
Table[Column]
)
- Returns the sum of an expression evaluated for each row in a table.
SUMXsupportsExpression
SUMX (
Table,
Table[Column1] * Table [Column2] // Accepts more than one column and expressions.
)
- Returns the
Largestvalue in the column, or larger value between twoScalarexpression. - Strings are compared according to Alphabetical order.
- MAX (
Date) returns the latest date. - Ignore
Booleanvalue.
MAX ( Table[Column] )
MAX ( Expression1, Expression2 )
MAXX (
Table,
Table[Column]
)
MAXAoperates withBooleandata type, it considerTRUEas1andFALSEas0
- Returns the
Largestvalue that results from evaluating an expression for each row of a table.
- Returns the
Smallestvalue in the column, or larger value between twoScalarexpression. - Strings are compared according to Alphabetical order.
- MIN (
Date) returns the oldest date. - Ignore
Booleanvalue.
MIN ( Table[Column] )
MIN ( Expression1, Expression2 )
MINX (
Table,
Table[Column]
)
MINAoperates withBooleandata type, it considerTRUEas1andFALSEas0
- Returns the
Smallestvalue that results from evaluating an expression for each row of a table.