OpenBI Docs Buy

QUOTIENT

The whole part of a division.

Group: Math. Compatible with DAX.

Syntax

QUOTIENT ( <numerator>, <denominator> )
ParameterTypeDescription
numeratorNumberThe number to divide.
denominatorNumberThe number to divide by; it may not be zero.

Returns

Whole number. How many whole times the denominator goes into the numerator; the remainder is dropped.

Remarks

  • The decimals of the division are cut off towards zero: QUOTIENT ( -7, 2 ) is -3, where INT ( -7 / 2 ) gives -4.
  • A denominator of zero, or a blank one, is an error. A blank numerator gives BLANK.
  • With positive numbers, QUOTIENT and MOD split a division into its whole part and its remainder: 30 crates are 3 pallets of 8 and 6 crates over.

Examples

Full pallets of 8 crates, and what is left

EVALUATE
ADDCOLUMNS (
    DATATABLE ( "Crates", INTEGER, { { 7 }, { 12 }, { 30 } } ),
    "Pallets", QUOTIENT ( [Crates], 8 ),
    "Left over", MOD ( [Crates], 8 )
)
ORDER BY [Crates]
CratesPalletsLeft over
707
1214
3036

Towards zero

EVALUATE
ROW (
    "QUOTIENT ( -7, 2 )", QUOTIENT ( -7, 2 ),
    "INT ( -7 / 2 )", INT ( -7 / 2 ),
    "QUOTIENT ( 7.9, 2 )", QUOTIENT ( 7.9, 2 )
)
QUOTIENT ( -7, 2 )INT ( -7 / 2 )QUOTIENT ( 7.9, 2 )
-3-43

MOD, DIVIDE, TRUNC, INT.

Last updated · OpenBI Studio 0.3.74