Number.IsOdd
NumberReturns true if a number is odd.
Syntax
Number.IsOdd(number as number) as logicalParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The number to check. |
Return Value
logical — true 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 | |
|---|---|---|---|
| 1 | 1 | Widget A | 25 |
| 2 | 3 | Widget C | 15 |
| 3 | 5 | Thingamajig E | 120 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks