ODD DAX Function (Math and Trig)
Returns number rounded up to the nearest odd integer.
Syntax
Parameter | Attributes | Description |
---|---|---|
Number |
The value to round. |
Return values
Returns number rounded up to the nearest odd integer.
Remarks
If number is nonnumeric, ODD returns the #VALUE! error value.
Regardless of the sign of number, a value is rounded up when adjusted away from zero. If number is an odd integer, no rounding occurs.
Examples
-- ODD and EVEN round to an even or odd number. -- The rounding happens by finding the nearest larger odd/even integer, -- considering the absolute value of the number. DEFINE VAR Vals = GENERATESERIES ( -5, +5, 2.1 ) EVALUATE ADDCOLUMNS ( Vals, "EVEN", EVEN ( [Value] ), "ODD", ODD ( [Value] ) ) ORDER BY [Value] ASC
Value | EVEN | ODD |
---|---|---|
-5.00 | -6 | -5 |
-2.90 | -4 | -3 |
-0.80 | -2 | -1 |
1.30 | 2 | 3 |
3.40 | 4 | 5 |
Related functions
Other related functions are:
Last update: Nov 14, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/odd-function-dax