Example 6—Excluding Selected Measures from a Dimension

In this example, the database role has access to cells for the Asia member and its descendants in the Geography dimension, but the role does not have access to cells for any other members in that dimension. The database role also does not have access to cells for the Revenue measure, including Revenue cells for Asia and its descendants.

The following expression is the Multidimensional Expressions (MDX) expression that sets these permissions:

Ancestor(Geography.CurrentMember,[Continent]) IS Asia 
AND Not Measures.CurrentMember IS Revenue

Reviewing the Result Set

Based on these cell data permissions for this database role, a query on all cells returns the result set shown in the following table.

Continent

Country/Region

Cost

Cost

Revenue

Revenue

Tax

Tax

1997

1998

1997

1998

1997

1998

Asia

.

1453

2507

#N/A

#N/A

182

266

.

Japan

1111

2009

#N/A

#N/A

133

210

.

Korea

342

498

#N/A

#N/A

49

56

Europe

.

#N/A

#N/A

#N/A

#N/A

#N/A

#N/A

.

France

#N/A

#N/A

#N/A

#N/A

#N/A

#N/A

.

Germany

#N/A

#N/A

#N/A

#N/A

#N/A

#N/A

N. America

.

#N/A

#N/A

#N/A

#N/A

#N/A

#N/A

.

Canada

#N/A

#N/A

#N/A

#N/A

#N/A

#N/A

.

USA

#N/A

#N/A

#N/A

#N/A

#N/A

#N/A

Important

If a Microsoft Windows user or group belongs to multiple database roles, a query on all cells would first result in a dataset being generated based on each database role to which the user or group belongs. Then, MicrosoftSQL ServerAnalysis Services would combine all these datasets into one dataset, and return that combined dataset to the user or group.