Market Share Calculation in MDX based on AXIS

Below is the MDX which will calculate market share at runtime/dynamically. It always reads data from the parent axis.

iif
 (
  Axis(1)(0)(Axis(1)(0).Count – 1).Dimension.CurrentMember.Parent is null,
  null,
   (
     [measures].[x]
     /
     (
    [measures].[x],Axis(1)(0)(Axis(1)(0).Count -1).Dimension.CurrentMember.Parent
   )
  )
 
  * 100
 )


2 thoughts on “Market Share Calculation in MDX based on AXIS

  1. Did u try writing a SCOPE for ‘ALL’ member of your parent dimension. You can sum over the Market Share calculated measure inside that SCOPE.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.