Cube.MeasureProperty

Table

Returns the value of a named property from a measure.

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

Syntax

Cube.MeasureProperty(measure as any, propertyName as text) as any

Parameters

NameTypeRequiredDescription
measureanyYesA measure value from which to retrieve the property.
propertyNametextYesThe name of the measure property to retrieve.

Return Value

anyThe value of the specified property for the given measure.

Remarks

Cube.MeasureProperty returns the value of the property propertyName from the specified measure. This function is the measure counterpart of Cube.AttributeMemberProperty, which retrieves properties from dimension attribute members.

Common measure properties you can retrieve include:

  • FORMAT_STRING -- the format pattern for displaying measure values.
  • MEASURE_AGGREGATOR -- the aggregation type (e.g., Sum, Count, Distinct Count).
  • MEASURE_DISPLAY_FOLDER -- the display folder where the measure is organized.
  • DESCRIPTION -- the description text defined for the measure.

The list of available property names can be discovered using Cube.MeasureProperties.

Examples

Example 1: Get the format string of a measure

let
    Source = AnalysisServices.Database("localhost", "AdventureWorks"),
    Cube = Source{[Name = "Adventure Works"]}[Data],
    Measures = Cube.Measures(Cube),
    SalesMeasure = Measures{[Name = "Internet Sales Amount"]}[Value],
    FormatString = Cube.MeasureProperty(SalesMeasure, "FORMAT_STRING")
in
    FormatString

Example 2: Get the aggregation type of a measure

let
    Source = AnalysisServices.Database("localhost", "AdventureWorks"),
    Cube = Source{[Name = "Adventure Works"]}[Data],
    Measures = Cube.Measures(Cube),
    CountMeasure = Measures{[Name = "Internet Order Count"]}[Value],
    Aggregator = Cube.MeasureProperty(CountMeasure, "MEASURE_AGGREGATOR")
in
    Aggregator

Compatibility

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