TRUNC

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)

***** Related Blog Posts *****
60 Page DAX Formula Reference Guide Download Now Available
Show Only Top Or Bottom Results Using Ranking Formula Techniques – Power BI & DAX

***** Related Video Tutorials *****
Ultimate Beginners Guide to DAX

What Is DAX? & Why Do You Need To Learn It – (1.2) Ultimate Beginner Guide to DAX
Formula Syntax, Comments & Variables – (1.6) Ultimate Beginners Guide to DAX
Examples Of Advanced DAX – (1.18) Ultimate Beginners Guide to DAX

***** Related Course Modules *****
Ultimate Beginners Guide to DAX
Mastering DAX Calculations
Solving Analytical Scenarios w/ Power BI and DAX
DAX Formula Deep Dives
Advanced DAX Combinations

***** Related Support Forum Posts*****
Mastering DAX Calculations: What Is DAX?
Understanding DAX Formula
Developing Complex Dax functions
Data Types And Operators