Number.IsEven

Number

Returns true if a number is even.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Number.IsEven(number as number) as logical

Parameters

NameTypeRequiredDescription
numbernumberYesThe number to check.

Return Value

logicaltrue if the number is even; false otherwise.

Remarks

Number.IsEven returns true when a number is divisible by 2 with no remainder, and false otherwise. This is a shorthand for Number.Mod(number, 2) = 0.

A practical use case is applying alternating row styling logic, filtering even-numbered records, or splitting data into two groups based on ID parity.

Examples

Example 1: Check which OrderIDs are even

Table.AddColumn(
    Table.SelectColumns(Table.FirstN(Sales, 6), {"OrderID", "Product"}),
    "IsEven", each Number.IsEven([OrderID]), type logical
)
Result
OrderID
Product
IsEven
11Widget AFALSE
22Gadget BTRUE
33Widget CFALSE
44Gadget DTRUE
55Widget AFALSE
66Thingamajig ETRUE

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks