Ancestor

Returns the ancestor of a member at specified level or distance.

Syntax

Ancestor(<Member_Expression>,<Level>)
Ancestor(<Member_Expression>,<Numeric_Expression>)

Arguments

Member_ExpressionMDX expression that returns a member.
LevelMDX expression specifying a member level of the ancestor.
Numeric_ExpressionA number to specify a distance between the member and the ancestor.

Examples

Following example returns issue's epic Epic Status for parent issues and sub-tasks.

CASE WHEN
 NOT ([Issue.Epic].CurrentMember IS [Issue.Epic].DefaultMember)
THEN
 Ancestor([Issue.Epic].CurrentMember,[Issue.Epic].[Epic]).get('Epic Status')
END