DAX Math & Trigonometric - TRUNC function


Advertisements

Description

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

Syntax

TRUNC (<number>) 

Parameters

Sr.No. Parameter & Description
1

number

The number you want to truncate.

Return Value

A whole number.

Remarks

DAX TRUNC and INT functions result in the same integer for positive numbers.

  • TRUNC removes the fractional part of the number.

  • INT rounds the number down to the nearest integer.

However, DAX TRUNC and INT functions might result in different integers for negative numbers.

  • TRUNC removes the fractional part of the number.

  • INT rounds the number down to the nearest integer based on the value of the fractional part of the number.

For example, TRUNC (-6.3) returns -6, but INT (-6.3) returns -7 because -7 is the nearest integer.

Example

= TRUNC (5.8) returns 5. 
= TRUNC (-5.8) returns -5. 
dax_functions_mathematical_trigonometric.htm

Useful Video Courses


Video

Mastering DAX and Data Models in Power BI Desktop

53 Lectures 5.5 hours

Abhay Gadiya

Video

Mastering DAX Studio

Featured

24 Lectures 2 hours

Randy Minder

Video

DAX / Power BI - Customer and Sales Analysis Deep Dive

26 Lectures 4.5 hours

Randy Minder

Advertisements