ODDDAX Function (Math and Trig)

Returns number rounded up to the nearest odd integer.

Syntax

ODD ( <Number> )
Parameter Attributes Description
Number

The value to round.

Return values

Scalar A single integer value.

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.

» 1 related function

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
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: Jul 12, 2024     » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://docs.microsoft.com/en-us/dax/odd-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.

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 ODD? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.