Number.IntegerDivide

Number

Performs integer (floor) division, returning the quotient without the remainder.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Number.IntegerDivide(number1 as nullable number, number2 as nullable number, optional precision as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
number1numberYesThe dividend.
number2numberYesThe divisor. Must not be zero.
precisionnumberNoAn optional precision value. Typically omitted; use Precision.Decimal for decimal-aware division.

Return Value

numberThe integer quotient of dividing number1 by number2.

Remarks

Number.IntegerDivide returns the integer quotient of dividing number1 by number2, discarding any remainder. For positive operands this is equivalent to Number.RoundDown(number1 / number2). It always truncates toward negative infinity (floor division), not toward zero — this is relevant when operands have different signs.

The remainder (what Number.IntegerDivide discards) can be obtained with Number.Mod. The two are complementary: (Number.IntegerDivide(a, b) * b) + Number.Mod(a, b) = a.

Dividing by zero raises a runtime error. If your data might contain zero divisors, guard with if [Divisor] = 0 then null else Number.IntegerDivide([Value], [Divisor]) or use try/otherwise.

The optional precision parameter accepts Precision.Decimal to perform decimal-aware division; for most use cases omit this parameter.

Common uses: bucketing quantities into fixed-size groups (Number.IntegerDivide(quantity, groupSize) * groupSize), computing whole time units from a total, and chunking data for batch processing.

Examples

Example 1: How many full weeks fit in 17 days?

Result
Result
12

Example 2: Split total days into full weeks and remaining days

let
    TotalDays = 17,
    Weeks = Number.IntegerDivide(TotalDays, 7),
    Remaining = Number.Mod(TotalDays, 7)
in
    #table({"Weeks", "RemainderDays"}, {{Weeks, Remaining}})
Applied Steps

The final output — a single-row table showing Weeks = 2 and RemainderDays = 3.

Weeks
RemainderDays
123

Example 3: Bucket order quantities into groups of 5

Table.AddColumn(
    Table.SelectColumns(Table.FirstN(Sales, 5), {"OrderID", "CustomerName", "Quantity"}),
    "QtyBucket",
    each Number.IntegerDivide([Quantity], 5) * 5,
    type number
)
Result
OrderID
CustomerName
Quantity
QtyBucket
11Alice40
22Bob20
33Charlie1010
44Alice10
55Diana65

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks