DIVIDEDIVIDE

{1}执行除法运算,并在被 0 除时返回备用结果或 BLANK()。{2}Performs division and returns alternate result or BLANK() on division by 0.

语法Syntax

DIVIDE(<numerator>, <denominator> [,<alternateresult>])  

parametersParameters

术语Term 定义Definition
分子numerator {1}被除数,即被除的数字。{2}The dividend or number to divide.
分母denominator 除数,或要除以的数字。The divisor or number to divide by.
alternateresultalternateresult {1}(可选)被零除而导致错误时返回的值。{2}(Optional) The value returned when division by zero results in an error. {1}如果没有提供,则默认值为 BLANK()。{2}When not provided, the default value is BLANK().

返回值Return value

一个小数。A decimal number.

备注Remarks

被 0 除时的备用结果必须是一个常量。Alternate result on divide by 0 must be a constant.

示例Example

以下示例返回 2.5。The following example returns 2.5.

=DIVIDE(5,2)  

示例Example

以下示例返回 BLANK。The following example returns BLANK.

=DIVIDE(5,0)  

示例Example

以下示例返回 1。The following example returns 1.

=DIVIDE(5,0,1)  

另请参阅See also

QUOTIENT 函数 (DAX)QUOTIENT function (DAX)
数学与三角函数 (DAX)Math and Trig functions (DAX)