Position Function

Top Previous Topic Next Topic  Print this topic

The Position function returns the position of the current iterated record in the referenced data source.

 

Note:

In order to use this function, an iteration must be started on the data source.

 

The following example lists all employees in ascending order. The "position" attribute specifies the position of the current iterated record in the output.

 

Position

 

 

Note:

The above example is part of the Position.dax document, located in the Samples/Job Samples folder.

 

Output:

 

 

       <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

       <ns:root xmlns:ns="http://www.tempuri.org/XML">

               <ns:element-name first-name="Arthur" last-name="Clark" id="3" position="1"/>

               <ns:element-name first-name="John" last-name="Brown" id="1" position="2"/>

               <ns:element-name first-name="Mary" last-name="Jane" id="2" position="3"/>

       </ns:root>