CurrentMember (MDX)

Updated: 17 July 2006

Returns the current member along a specified hierarchy during iteration.



A valid Multidimensional Expressions (MDX) expression that returns a hierarchy.

When iterating through a set of hierarchy members, at each step in the iteration, the member being operated upon is the current member. The CurrentMember function returns that member.

When a dimension contains only a single visible hierarchy, the hierarchy can be referred to either by the dimension name or by the hierarchy name, because the dimension name is resolved to its only visible hierarchy. For example, Measures.CurrentMember is a valid MDX expression because it resolves to the only hierarchy in the Measures dimension.


The following example returns the order quantity of each product and the percentage of order quantities by category and model, from the Adventure Works cube. The CurrentMember function identifies the product whose order quantity is to be used during calculation.

   MEMBER [Measures].[Order Percent by Category] AS
      ([Product].[Product Categories].CurrentMember,
        Measures.[Order Quantity]) / 
           ( [Product].[Product Categories].CurrentMember, 
             [Product].[Product Categories].[Category]
           ), Measures.[Order Quantity]
       ), 0
   ), FORMAT_STRING='Percent'
   {Measures.[Order Quantity],
      [Measures].[Order Percent by Category]} ON COLUMNS,
{[Product].[Product].Members} ON ROWS
FROM [Adventure Works]
WHERE {[Date].[Calendar Year].[Calendar Year].&[2003]}

Release History

17 July 2006

Changed content:
  • Updated syntax and arguments to improve clarity.
  • Added updated examples.

Community Additions