Value.Alternates

Value

Expresses alternate query plans within a query plan expression. Not intended for general use.

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

Syntax

Value.Alternates(alternates as list) as any

Parameters

NameTypeRequiredDescription
alternateslistYesA list of alternate query plan expressions to choose from.

Return Value

anyA value representing the selected alternate query plan.

Remarks

Value.Alternates expresses alternate query plans within a query plan expression obtained through Value.Expression(Value.Optimize(...)). It is an advanced, engine-internal function and is not intended for general use in user-written M queries.

When the Power Query engine optimizes a query via Value.Optimize, it may produce multiple possible execution strategies (e.g., different query folding paths, join strategies, or filter push-down approaches). Value.Alternates encodes these alternatives into the expression tree so the engine can select the most efficient plan at evaluation time.

This function is primarily relevant to custom connector development and engine internals. Calling Value.Alternates directly in a standard data transformation query has no practical benefit and may produce unexpected results. The alternates list is expected to contain valid query plan nodes as produced by the engine's optimization pipeline.

If you encounter Value.Alternates in a query plan expression returned by Value.Expression(Value.Optimize(...)), it indicates the engine identified multiple execution strategies for that portion of the query.

Examples

Example 1: Inspect an optimized expression that may contain alternates

let
    Optimized = Value.Optimize(42),
    Expr = Value.Expression(Optimized)
in
    Expr
Output
Kind
Value
1Constant42

Compatibility

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