EVEN DAX Function (Math and Trig)
Returns number rounded up to the nearest even integer. You can use this function for processing items that come in twos. For example, a packing crate accepts rows of one or two items. The crate is full when the number of items, rounded up to the nearest two, matches the crate’s capacity.
Syntax
| Parameter | Attributes | Description |
|---|---|---|
| Number |
The value to round. |
Return values
An even integer, with the data type of Number.
Remarks
EVEN rounds Number away from zero to the nearest even integer. A positive number goes up and a negative number goes down. For example, EVEN ( 1.5 ) returns 2, EVEN ( -1.5 ) returns -2, and EVEN ( -2.5 ) returns -4. If Number is an even integer, EVEN returns it without a change, and EVEN ( 0 ) returns 0.
If Number is BLANK, the result is BLANK. DAX converts a text that contains a number: EVEN ( “3” ) returns 4. DAX also converts a Boolean value: EVEN ( TRUE ) returns 2 and EVEN ( FALSE ) returns 0. If Number is a text that is not a number, EVEN returns an error.
This function is not supported in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
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 |
-- A crate holds rows of two items. EVEN rounds the number of items
-- up to the next multiple of two, to get the number of full places.
EVALUATE
ADDCOLUMNS (
{ 5, 6, 7, 8, 9 },
"Places", EVEN ( [Value] ),
"Rows", EVEN ( [Value] ) / 2
)
| Value | Places | Rows |
|---|---|---|
| 5 | 6 | 3.0 |
| 6 | 6 | 3.0 |
| 7 | 8 | 4.0 |
| 8 | 8 | 4.0 |
| 9 | 10 | 5.0 |
Related functions
Other related functions are:
Last update: Nov 17, 2026 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://learn.microsoft.com/en-us/dax/even-function-dax