
228 Practical PowerPivot & DAX Formulas for Excel 2010
T
he aggregate functions include the Statistical functions and both SUM() and
SUMX() from the Math & Trig functions. Such functions often result in
numeric values. The functions can be used equally well as calculated columns
or as measures. If used as calculated columns, they are often added to the Values drop-zone
in the PowerPivot Field List and displayed in the central data area of a pivot table.
They are ideally suited for producing totals and subtotals. In this chapter, the alphabetical
order of the functions has not been observed completely. For example, AVERAGEX()
appears before AVERAGEA(), but after AVERAGE()—this is to highlight the difference
between a base column function, such as AVERAGE(), and its table function equivalent,
AVERAGEX(). AVERAGEA(), another column function, then follows. In general, the
X-functions, for instance, AVERAGEX(), accept a table argument. The base functions,
like AVERAGE(), accept a column argument, and they operate on numeric or date
values. The A-functions, for example, AVERAGEA(), also accept a column argument, but
they usually work on every value in a column, even text and blank values.
C
Key concepts Aggregating data, averaging data, counting rows, summing data,
finding minimum and maximum values
C
Keywords AVERAGE(), AVERAGEX(), AVERAGEA(), COUNT(), COUNTX(),
COUNTA(), COUNTAX(), COUNTBLANK(), COUNTROWS(), MAX(), MAXX(),
MAXA(), MIN(), MINX(), MINA(), SUM(), SUMX()
AVERAGE()
AVERAGE() finds the mean of all the numeric values in the specified column. The
average of date values is returned as a serial number.
This example is a calculated column in the Order Details table.
Syntax
='Order Details'[Sales Amount] - AVERAGE('Order Details'[Sales Amount])
Result