Value.Metadata is a Power Query M function that retrieves a record containing the input value’s metadata. The function returns a record with metadata for the input value.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Value.Metadata( value as any ) as any
Description
The Value.Metadata function retrieves the metadata associated with a given value. It returns this metadata as a record, allowing you to inspect any annotations or properties attached to the value.
Examples
To explore how Value.Metadata works, let’s consider an example where a value has metadata attached. We start by creating a value with metadata.
In Power Query, you can attach metadata to a value using the meta keyword. For instance:
2025 meta [ Year = "Year of the Snake", Quality = "Intuitive" ]
This value has two pieces of metadata:
- Year: Describes the year in a cultural context.
- Quality: Indicates a characteristic.
To inspect this metadata, we pass the value to the Value.Metadata function as follows:
// Returns: [ Year = "Year of the Wood Snake", Quality = "Intuitive" ]
let
MetaValue = 2025 meta [ Year = "Year of the Snake", Quality = "Intuitive" ],
MetaData = Value.Metadata( MetaValue )
in
MetaData
The expression returns all the metadata properties attached to the value as a record. The record then allows you to inspect or work with the attached values.
Related articles
Learn more about Value.Metadata in the following articles:
- Power Query M Primer (Part 20): Metadata
The article explains how Power Query allows attaching metadata—additional information—to values. It specifies methods to inspect, set, and merge metadata, and discusses its applications, such as parameter configuration in Power BI. » Read more
Related functions
Other functions related to Value.Metadata are:
2023-2026 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy