Daily DAX : Day 113 INT

 The INT function in Power BI's Data Analysis Expressions (DAX) is used to round a number down to the nearest integer. Here's a detailed explanation:


Syntax:

dax


INT(number)



    number: This is the number you want to round down. It can be any real number.



How It Works:


    If the input number is positive, INT rounds it down to the next lower integer.

    If the input number is negative, INT rounds it away from zero to the next lower integer (which means further negative).



Examples:


    Positive Number:

        INT(3.7) returns 3

        INT(2.1) returns 2

    Negative Number:

        INT(-2.7) returns -3

        INT(-1.1) returns -2

    Zero and Integers:

        INT(0) returns 0

        INT(5) returns 5



Main Use Cases:


    Data Cleansing: When you need to convert floating-point numbers to integers for consistency or to prepare data for further analysis where only integer values are meaningful or required.

    Calculations Involving Discrete Quantities: For instance, if you're dealing with counts or quantities where partial units don't make sense (like number of items, people, etc.), you might use INT to ensure you're working with whole numbers.

    Time Calculations: When dealing with time in seconds, minutes, etc., and you need to convert to whole units without considering the fractional part (e.g., converting 25.9 hours to 25 hours for scheduling purposes).

    Financial Calculations: Sometimes, financial calculations require rounding down to the nearest cent or dollar for conservative estimates or to comply with certain accounting practices.

    Data Visualization: To simplify charts or graphs by removing decimal places where precision isn't necessary.



Here's how you might use INT in a DAX measure:


dax


Measure = INT(SUM('Table'[Value]))



This measure would sum up all the values in the 'Value' column of 'Table' and then round down the result to the nearest integer.


Remember, INT is specifically for rounding down; if you need to round to the nearest integer or round up, you would use other DAX functions like ROUND or CEILING, respectively.


https://dax.guide/

Comments

Popular posts from this blog

Daily DAX : Day 65 INFO.TABLEPERMISSIONS

Daily DAX : Day 55 PV