Value.Is

Value

Checks whether a value is compatible with a specified type.

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

Syntax

Value.Is(value as any, type as type) as logical

Parameters

NameTypeRequiredDescription
valueanyYesThe value to check.
typetypeYesThe type to check against (e.g., type number, type text, type date).

Return Value

logicalTrue if the value is compatible with the specified type, otherwise false.

Remarks

Value.Is returns true if a value is compatible with the specified type, and false otherwise. This is useful for type-checking before performing type-specific operations, or for building conditional logic that handles mixed-type columns.

Common type checks include type number, type text, type logical, type date, type record, type list, and type table.

Examples

Example 1: Check if Sales OrderID values are numbers

let
    FirstRow = Table.First(Sales),
    CheckOrderID = Value.Is(FirstRow[OrderID], type number),
    CheckName = Value.Is(FirstRow[CustomerName], type number)
in
    #table(
        {"Field", "Value", "IsNumber"},
        {
            {"OrderID", Text.From(FirstRow[OrderID]), Text.From(CheckOrderID)},
            {"CustomerName", FirstRow[CustomerName], Text.From(CheckName)}
        }
    )
Result
Field
Value
IsNumber
1OrderID1true
2CustomerNameAlicefalse

Compatibility

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