Value.RemoveMetadata

Value

Returns a copy of a value with all metadata removed, or with specified metadata fields removed.

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

Syntax

Value.RemoveMetadata(value as any, optional metadataRecord as nullable record) as any

Parameters

NameTypeRequiredDescription
valueanyYesThe value whose metadata is removed.
metadataRecordrecordNoAn optional record specifying which metadata fields to remove. If omitted, all metadata is removed.

Return Value

anyThe value with metadata removed.

Remarks

Value.RemoveMetadata strips the metadata record from a value, returning the value with no (or fewer) metadata fields. There are two modes:

- Without the optional parameter: removes all metadata — the result has an empty metadata record - With a metadataRecord parameter: removes only the metadata fields whose names appear as fields in the provided record; other metadata fields are retained

The underlying data value is not changed — only the attached metadata record is modified. This is the destructive counterpart to Value.ReplaceMetadata.

Common use cases include:

- Cleaning values before output: stripping internal engine annotations before returning values to end users or downstream systems - Selective metadata removal: keeping useful annotations (e.g., display names) while removing internal bookkeeping fields - Testing: verifying that a value after an operation carries no unexpected metadata

Note that most M operations already discard metadata automatically. Value.RemoveMetadata is only needed when you have explicitly attached metadata and want to explicitly remove it, or when you receive a value from a connector that carries metadata you want to strip.

Examples

Example 1: Remove all metadata from a value

let
    Annotated = 42 meta [Source = "Raw", Verified = false],
    Clean = Value.RemoveMetadata(Annotated)
in
    Value.Metadata(Clean)
Applied Steps

The final output — retrieves the metadata from the cleaned value, returning an empty record (no rows) confirming all metadata was removed.

Name
Value

Example 2: The underlying value is preserved after removing metadata

let
    Annotated = 42 meta [Source = "Raw"],
    Clean = Value.RemoveMetadata(Annotated)
in
    Clean
Applied Steps

The final output — returns the cleaned value directly, showing that the number 42 is intact after metadata removal.

Result
142

Example 3: Verify that stripped value equals the unwrapped literal

let
    Annotated = "hello" meta [Tag = "test"],
    Stripped = Value.RemoveMetadata(Annotated)
in
    Value.Equals(Stripped, "hello")
Applied Steps

The final output — checks that the stripped value is equal to the plain literal "hello", returning true to confirm the underlying value is unchanged.

Result
1TRUE

Compatibility

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