QUOTIENT DAX Function (Math and Trig)

Returns the integer portion of a division.

Syntax

QUOTIENT ( <Numerator>, <Denominator> )
Parameter Attributes Description
Numerator

The dividend.

Denominator

The divisor.

Return values

Scalar A single integer value.

Returns only the integer portion of the division result.

» 3 related functions

Examples

QUOTIENT ( 0, 2 ) -- returns 0
QUOTIENT ( 1, 2 ) -- returns 0
QUOTIENT ( 4, 2 ) -- returns 2
QUOTIENT ( 5, 2 ) -- returns 2
QUOTIENT ( 6, 2 ) -- returns 3
QUOTIENT ( 6, 3 ) -- returns 2
QUOTIENT ( 7, 3 ) -- returns 2
--  MOD returns the remainder of an integer division by A and B
--  whereas QUOTIENT returns the integer part of the quotient
DEFINE
    VAR Val1 = SELECTCOLUMNS ( GENERATESERIES ( 3, 6, 1 ), "Val1", [Value] )
    VAR Val2 = SELECTCOLUMNS ( GENERATESERIES ( 2, 4, 1 ), "Val2", [Value] )
EVALUATE
ADDCOLUMNS ( 
    CROSSJOIN ( Val1, Val2 ),
    "Division", DIVIDE   ( [Val1], [Val2] ),
    "QUOTIENT", QUOTIENT ( [Val1], [Val2] ),
    "MOD",      MOD      ( [Val1], [Val2] ),
    "Mod/Div",  MOD ( [Val1], [Val2] ) / [Val2]
)
ORDER BY [Val1] DESC, [Val2] ASC
Val1 Val2 Division QUOTIENT MOD Mod/Div
6 2 3.00 3 0 0.00
6 3 2.00 2 0 0.00
6 4 1.50 1 2 0.50
5 2 2.50 2 1 0.50
5 3 1.67 1 2 0.67
5 4 1.25 1 1 0.25
4 2 2.00 2 0 0.00
4 3 1.33 1 1 0.33
4 4 1.00 1 0 0.00
3 2 1.50 1 1 0.50
3 3 1.00 1 0 0.00
3 4 0.75 0 3 0.75
--  MOD returns the remainder of an integer division by A and B
--  whereas QUOTIENT returns the integer part of the quotient.
DEFINE
    VAR Val1 = SELECTCOLUMNS ( GENERATESERIES ( 0.5, 3.3, 1.6 ), "Val1", [Value] )
    VAR Val2 = SELECTCOLUMNS ( GENERATESERIES ( 0.5, 2.8, 1.1 ), "Val2", [Value] )
EVALUATE
ADDCOLUMNS ( 
    CROSSJOIN ( Val1, Val2 ),
    "Division", DIVIDE   ( [Val1], [Val2] ),
    "QUOTIENT", QUOTIENT ( [Val1], [Val2] ),
    "MOD",      MOD      ( [Val1], [Val2] ),
    "Mod/Div",  MOD ( [Val1], [Val2] ) / [Val2]
)
ORDER BY [Val1] DESC, [Val2] ASC
Val1 Val2 Division QUOTIENT MOD Mod/Div
2.10 0.50 4.20 4 0.10 0.20
2.10 1.60 1.31 1 0.50 0.31
2.10 2.70 0.78 0 2.10 0.78
0.50 0.50 1.00 1 0.00 0.00
0.50 1.60 0.31 0 0.50 0.31
0.50 2.70 0.19 0 0.50 0.19

Related functions

Other related functions are:

Last update: Dec 14, 2024   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://docs.microsoft.com/en-us/dax/quotient-function-dax

2018-2024 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of QUOTIENT? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.