There are times when we need to know whether the current context is pointing to the root member of a hierarchy or not.
Root member is the topmost member of a hierarchy. It is present in all hierarchies (in user hierarchies as well as in attributes hierarchies) as long as the
IsAggregatable property is in its default state, enabled.
This recipe shows how to detect the root member.
Start SQL Server Management Studio and connect to your SSAS 2008 R2 instance. Click on the New Query button and check that the target database is Adventure Works DW 2008R2.
In this example we're going to use the same Color hierarchy of the Product dimension like in the previous recipe, Detecting a particular member of a hierarchy