
DESCENDANTS(<member>, <distance> [, <desc_flags>])
All descendants of <member> that are <distance> steps away from <member>. Otherwise identical to the original form of DESCENDANTS, it is useful when dealing with ragged hierarchies.
For example,
yields all states in the USA, while the statement
might return all cities in Israel.
The use of <desc_flags> is the same as for the original form of DESCENDANTS. For example, the statement
DESCENDANTS(USA, 2, BEFORE)
would also return all states in the USA.
The LEAVES flag can be used to return all the leaf-level descendants of the given member, up to <distance> steps away. In a Geography dimension, the statement
DESCENDANTS(Geography.[All], 4, LEAVES)
might return all cities in the hierarchy, or possibly counties or states if those members contain no children.
DESCENDANTS(<member>, 0, LEAVES) would return <member>.