Arranges members of a set, optionally preserving or breaking the hierarchy.
Order(Set_Expression, Value) Order(Set_Expression, Value, Symbol)
|MDX expression that returns set.|
|Value by which this set should be ordered|
ASC, DESC - orders ascending or descending within members hierarchy
BASC, BDESC - orders ascending or descending overriding members hierarchy
The following example would get all the invoices for the selected customer, would sort them by Invoice date, return the last invoice and show it's date.
Order( Filter( NonEmptyCrossJoin( [Invoice].[Invoice].members, [Customer].CurrentMember ), NOT IsEmpty([Measures].[Invoice base amount]) ), [Invoice].CurrentMember.get('Invoice date'), DESC ).Item(0).Item(0).get('Invoice date')