Number.IsOdd

Number

Returns true if a number is odd.

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

Syntax

Number.IsOdd(number as number) as logical

Parameters

NameTypeRequiredDescription
numbernumberYesThe number to check.

Return Value

logicaltrue if the number is odd; false otherwise.

Remarks

Number.IsOdd returns true when a number is not divisible by 2, and false otherwise. This is a shorthand for Number.Mod(number, 2) <> 0.

Use this alongside Number.IsEven for parity-based filtering, or to split datasets into alternating groups.

Examples

Example 1: Filter to odd-numbered ProductIDs

Table.SelectColumns(
    Table.SelectRows(Products, each Number.IsOdd([ProductID])),
    {"ProductID", "ProductName", "Price"}
)
Result
ProductID
ProductName
Price
11Widget A25
23Widget C15
35Thingamajig E120

Compatibility

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