Type.IsNullable

Type

Returns true if the given type is a nullable type — one that can hold null values.

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

Syntax

Type.IsNullable(type as type) as logical

Parameters

NameTypeRequiredDescription
typetypeYesThe type to test.

Return Value

logicalTrue if the type is nullable, false otherwise.

Remarks

Type.IsNullable returns true when a type is a nullable type — one that permits null values. In Power Query M, nullable types are expressed using the nullable keyword: type nullable number, type nullable text, and so on.

The primitive types such as type number and type text are non-nullable by default — they are distinct type values from type nullable number and type nullable text. Most built-in Power Query M functions accept and return nullable variants of their parameter types (e.g., the number parameter of Number.Round is typed as nullable number), meaning they gracefully handle null inputs.

Type.IsNullable is useful when:

- Inspecting column types programmatically to decide whether null-handling is needed - Building generic transformation functions that behave differently for nullable vs non-nullable fields - Validating that a type annotation includes a nullable wrapper before applying Type.NonNullable to strip it

To make a type non-nullable, use Type.NonNullable. To make a type nullable, use the type nullable X expression — there is no dedicated Type.Nullable function.

Examples

Example 1: A nullable type returns true

Type.IsNullable(type nullable number)
Result
Result
1TRUE

Example 2: A non-nullable primitive type returns false

Type.IsNullable(type number)
Result
Result
1FALSE

Example 3: Inspect the nullability of the type of a literal value

let
    ColType = Value.Type(42),
    IsNullable = Type.IsNullable(ColType)
in
    IsNullable
Applied Steps

The final output — checks whether the type of 42 is nullable using Type.IsNullable, returning false because type number does not allow null.

Result
1FALSE

Compatibility

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