320 Practical PowerPivot & DAX Formulas for Excel 2010
T
his is the final chapter dealing with DAX functions and formulas. It deals
with the Math & Trig functions. However, you won’t find any trigonometric
functions as such—expect these to appear in a later version of PowerPivot for
Excel. Some of the functions, for example, EXP() and LN(), are probably for specialized
use only. However, many of the others are going to be very popular—particularly, the
eight functions devoted to rounding numbers. SUM() and SUMX() are Math & Trig
functions, although they have much in common with the Statistical functions as well.
They were both covered in an earlier chapter on aggregate functions (that is, Statistical
functions with SUM() and SUMX()), but are mentioned here again for completeness. In
any case, SUMX() is worth a second look, as it will be very useful in many BI situations.
C
Key concepts Arithmetic manipulation, exponents and logarithms, rounding up
and/or down, summing data
C
Keywords ABS(), CEILING(), EXP(), FACT(), FLOOR(), INT(), ISO.
CEILING(), LN(), LOG(), LOG10(), MOD(), MROUND(), PI(), POWER(),
QUOTIENT(), RAND(), RANDBETWEEN(), ROUND(), ROUNDDOWN(),
ROUNDUP(), SIGN(), SQRT(), SUM(), SUMX(), TRUNC()
ABS()
ABS() simply converts a negative number into a positive one, and leaves positive
numbers unchanged. The example uses the Products table.
Syntax
=ABS(Products[UnitsInStock]-Products[ReorderLevel])
Result