Value functions

 

The Power Query Formula Language is a powerful query language optimized for building queries that mashup data. It's a functional, case sensitive language similar to F#, which can be used with Power Query in Excel, Get & Transform in Excel 2016, and Power BI Desktop. To learn more, see the PowerQueryName reference.

FunctionDescription
Value.CompareReturns 1, 0, or -1 based on value1 being greater than, equal to, or less than the value2. An optional comparer function can be provided.
Value.EqualsReturns whether two values are equal.
Value.NativeQueryEvaluates a query against a target.
Value.NullableEqualsReturns a logical value or null based on two values .
Value.TypeReturns the type of the given value.

Arithmetic operations

FunctionDescription
Value.AddReturns the sum of the two values.
Value.DivideReturns the result of dividing the first value by the second.
Value.MultiplyReturns the product of the two values.
Value.SubtractReturns the difference of the two values.

Parameter types

TypeDescription
Value.AsValue.As is the function corresponding to the as operator in the formula language. The expression value as type asserts that the value of a value argument is compatible with type as per the is operator. If it is not compatible, an error is raised.
Value.IsValue.Is is the function corresponding to the is operator in the formula language. The expression value is type returns true if the ascribed type of vlaue is compatible with type, and returns false if the ascribed type of value is incompatible with type.
Value.ReplaceTypeA value may be ascribed a type using Value.ReplaceType. Value.ReplaceType either returns a new value with the type ascribed or raises an error if the new type is incompatible with the value’s native primitive type. In particular, the function raises an error when an attempt is made to ascribe an abstract type, such as any. When replacing a the type of a record, the new type must have the same number of fields, and the new fields replace the old fields by ordinal position, not by name. Similarly, when replacing the type of a table, the new type must have the same number of columns, and the new columns replace the old columns by ordinal position.
ImplementationDescription
DirectQueryCapabilities.FromDirectQueryCapabilities.From
Embedded.ValueAccesses a value by name in an embedded mashup.
Value.FirewallValue.Firewall
Variable.ValueVariable.Value
SqlExpression.SchemaFromSqlExpression.SchemaFrom
SqlExpression.ToExpressionSqlExpression.ToExpression
FunctionDescription
Value.MetadataReturns a record containing the input’s metadata.
Value.RemoveMetadataRemoves the metadata on the value and returns the original value.
Value.ReplaceMetadataReplaces the metadata on a value with the new metadata record provided and returns the original value with the new metadata attached.
Show: