Table of contents
TOC
Collapse the table of content
Expand the table of content

TRUNC Function (DAX)

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

Truncates a number to an integer by removing the decimal, or fractional, part of the number.

Syntax

TRUNC(<number>,<num_digits>)  

Parameters

TermDefinition
numberThe number you want to truncate.
num_digitsA number specifying the precision of the truncation; if omitted, 0 (zero)

Return Value

A whole number.

Remarks

TRUNC and INT are similar in that both return integers. TRUNC removes the fractional part of the number. INT rounds numbers down to the nearest integer based on the value of the fractional part of the number. INT and TRUNC are different only when using negative numbers: TRUNC(-4.3) returns -4, but INT(-4.3) returns -5 because -5 is the smaller number.

Example

The following formula returns 3, the integer part of pi.

=TRUNC(PI())  

Example

The following formula returns -8, the integer part of -8.9.

=TRUNC(-8.9)  

See Also

Math and Trig Functions (DAX)
ROUND Function (DAX)
ROUNDUP Function (DAX)
ROUNDDOWN Function (DAX)
MROUND Function (DAX)
INT Function (DAX)

© 2018 Microsoft