Daily DAX : Day 353 EVEN

Power BI DAX EVEN Function

Description

The EVEN function in DAX (Data Analysis Expressions) rounds a number up to the nearest even integer. If the number is already an even integer, it remains unchanged. This function is useful for scenarios requiring even numbers, such as inventory management or scheduling.

Syntax

EVEN(number)
  • number: The value to round (required). Can be a number, column reference, or expression that evaluates to a number.

Return Value

An even integer, rounded up if necessary.

Use Case

The EVEN function is often used in business scenarios where quantities must be even, such as packaging items in pairs or ensuring even distribution in reports.

Example: A company sells products in pairs (e.g., shoes, gloves). If an order has an odd quantity, the EVEN function can round up to ensure pairs are maintained.

Example

Suppose you have a table with a column Quantity containing product order amounts. You want to ensure quantities are even for packaging.

EvenQuantity = EVEN('Table'[Quantity])
Quantity EvenQuantity
3 4
6 6
7.5 8
-3 -4

Notes

  • Negative numbers are rounded away from zero (e.g., EVEN(-3) returns -4).
  • Non-integer numbers are rounded up to the next even integer (e.g., EVEN(7.5) returns 8).
  • If the input is non-numeric, the function returns an error.

Comments

Popular posts from this blog

Daily DAX : Day 65 INFO.TABLEPERMISSIONS

Daily DAX : Day 55 PV