Skip to main content

CURRENTMEMBER.NAME

The CurrentMember.Name function returns the current member value of the specified dimension attribute during iteration.

Note

The syntax validation mechanism used when entering the MDX formula detects cases where the equals operator is used incorrectly for comparing the CurrentMember function to a scalar value. It also displays a warning about using the [Dimension].[Hierarchy].[Level].CurrentMember syntax.

If you need to disable these syntax checks, you can do so using the query.language.mdx.currentMember.allowLegacySyntax global setting. For details, see Configuring Global Settings.

Description

The CurrentMember.Name function allows you to evaluate dimension attribute values in a calculated measure formula. This is useful for conditional processing of measure values based on the value of a given dimension.

You must refer to dimension and secondary attributes by their query ID. The hierarchy expression pattern is always:

[DimensionQueryID].[HierarchyQueryID]

To refer to a dimension attribute of a role-playing dimension, be sure to prefix the attribute name with the role-playing prefix. For example:

[Order Dimension].[Order YearMonth].CurrentMember.Name
[Ship Dimension].[Ship YearMonth].CurrentMember.Name
note

You cannot combine measures from multiple facts in the same formula if using CURRENTMEMBER.NAME in your formula. You can only evaluate dimensions in a calculated measure formula with measures from a single fact table.

Syntax

[Level].CurrentMember.name
[Secondary Attribute].CurrentMember.name
Hierarchy_Expression.CurrentMember.Name
note

The CurrentMember function requires a valid hierarchy expression. When using the AtScale expression editor in Design Center, the attribute is inserted as a level expression. To correct this, convert the level expression to a hierarchy expression. See the example below. For more information pertaining to the CurrentMember.Name syntax, refer to the Microsoft documentation.

The level expression:

[Customer Dimension].[Occupation].[Occupation].CurrentMember.name="Professional"

Should be changed to a hierarchy expression:

[Customer Dimension].[Occupation].CurrentMember.name="Professional"

Return Value

Returns the current dimension member value for the given level attribute or secondary attribute name.

Input Parameters

N/A

Examples

  1. Order Type secondary attribute in the Order Dimension. typeorder is the query ID of Order Type.

    [Order Dimension].[typeorder].CurrentMember.name
  2. Order Retail445 hierarchy in the Order Date Dimension.

    [Order Date Dimension].[Order Retail445].CurrentMember.PrevMember