Table.WithErrorContext

TableInternal

Associates an error context string with a value. Intended for internal use only.

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

Syntax

Table.WithErrorContext(value as any, context as text) as any

Parameters

NameTypeRequiredDescription
valueanyYesThe value to associate with the error context.
contexttextYesA text string providing error context information.

Return Value

anyThe value with the specified error context attached.

Remarks

This function is intended for internal use only. It is part of the Power Query engine's error-handling infrastructure and is not designed for use in user-authored queries.

Table.WithErrorContext attaches a context string to a value, which the engine uses to provide more informative error messages when operations fail. The behavior and parameters of this function may change without notice between Power Query versions.

Examples

Example 1: Basic usage (internal function)

let
    Result = Table.WithErrorContext(Sales, "Loading sales data")
in
    Result

Compatibility

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