Value.As

This function will provide the value if it is suitable for the specified type. It works similarly to the "as" operator in M, but with the added capability of accepting identifier type references like ...

Syntax

Value.As(value as any, type as type) as any

About

This function will provide the value if it is suitable for the specified type. It works similarly to the "as" operator in M, but with the added capability of accepting identifier type references like Number.Type.

Explanation

Example 1 Convert a numerical value to a number type using Power Query M function Value.As. Syntax: Value.As(123, Number.Type) Output: 123 Example 2 Analyze an attempt to convert a text value to a numerical value in Power Query M. Syntax: Value.As("abc", type number) Output: [Expression.Error] Unable to convert the value "abc" to Number type.