text: ---
  description: "Current (MDX)"
  title: "Current (MDX) | Microsoft Docs"
  ms.date: 06/04/2018
  ms.prod: sql
  ms.technology: analysis-services
  ms.custom: mdx
  ms.topic: reference
  ms.author: owend
  ms.reviewer: owend
  author: minewiskan
  ---
  # Current (MDX)
  
  
    Returns the current tuple from a set during iteration.  
    
  ## Syntax  
    
  ```  
    
  Set_Expression.Current   
  ```  
    
  ## Arguments  
   *Set_Expression*  
   A valid Multidimensional Expressions (MDX) expression that returns a set.  
    
  ## Remarks  
   At each step during an iteration, the tuple being operated upon is the current tuple. The **Current** function returns that tuple. This function is only valid during an iteration over a set.  
    
   MDX functions that iterate through a set include the [Generate](../mdx/generate-mdx.md) function.  
    
  > [!NOTE]  
  >  This function only works with sets that are named, either using a set alias or by defining a named set.  
    
  ## Examples  
   The following example shows how to use the **Current** function inside **Generate**:  
    
   `WITH`  
    
   `//Creates a set of tuples consisting of all Calendar Years crossjoined with`  
    
   `//all Product Categories`  
    
   `SET MyTuples AS CROSSJOIN(`  
    
   `[Date].[Calendar Year].[Calendar Year].MEMBERS,`  
    
   `[Product].[Category].[Category].MEMBERS)`  
    
   `//Iterates through each tuple in the set and returns the name of the Calendar`  
    
   `//Year in each tuple`  
    
   `MEMBER MEASURES.CURRENTDEMO AS`  
    
   `GENERATE(MyTuples, MyTuples.CURRENT.ITEM(0).NAME, ", ")`  
    
   `SELECT MEASURES.CURRENTDEMO ON 0`  
    
   `FROM [Adventure Works]`  
    
  ## See Also  
   [MDX Function Reference &#40;MDX&#41;](../mdx/mdx-function-reference-mdx.md)  
    
    
  