RowExpression.Column

Expression

Returns an abstract syntax tree (AST) representing access to a column within a row expression.

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

Syntax

RowExpression.Column(columnName as text) as record

Parameters

NameTypeRequiredDescription
columnNametextYesThe name of the column to create an access expression for.

Return Value

recordA record representing a FieldAccess AST node for the specified column name.

Remarks

RowExpression.Column returns an abstract syntax tree (AST) record that represents accessing a named column within a row expression. The returned record has the Kind field set to "FieldAccess", with Expression set to RowExpression.Row and MemberName set to the provided column name.

This is an advanced/internal function used by the Power Query engine's expression tree infrastructure. It is primarily relevant for:

  • Custom connector development where query folding logic needs to construct or inspect column access expressions programmatically.
  • Building row expression ASTs that can be translated to native query languages.

In normal M query development, you access columns using [ColumnName] syntax inside each expressions. RowExpression.Column is the lower-level programmatic equivalent used in the expression tree representation.

Examples

Example 1: Create a column access AST node

let
    AST = RowExpression.Column("CustomerName")
in
    #table(
        {"Kind", "MemberName"},
        {{AST[Kind], AST[MemberName]}}
    )
Output
Kind
MemberName
1FieldAccessCustomerName

Compatibility

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