QUOTIENT
The whole part of a division.
Group: Math. Compatible with DAX.
Syntax
QUOTIENT ( <numerator>, <denominator> )
| Parameter | Type | Description |
|---|---|---|
numerator | Number | The number to divide. |
denominator | Number | The 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, whereINT ( -7 / 2 )gives -4. - A denominator of zero, or a blank one, is an error. A blank numerator gives BLANK.
- With positive numbers,
QUOTIENTandMODsplit 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]
| Crates | Pallets | Left over |
|---|---|---|
| 7 | 0 | 7 |
| 12 | 1 | 4 |
| 30 | 3 | 6 |
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 | -4 | 3 |