Calculating Market Share %

  • If I understand your question, I think the problem is that the only intersection between your total Market Sales and your product dimension is at the top of the dimension. In MDX, if you do not define a specific member from a dimension, it always assumes the current member. That would mean that your formula is dividing your own sales for your product filter selection by Total sales for the same product selection. If this is the case, you would need to add the Product dimension to your tuple with something like this....

    IIF(IsEmpty(([Measures].[Total],[Date].Currentmember)),0,([Measures].[Amount])/([Measures].[Total],[Products].[All Products],[Date].Currentmember)))

    Also, be sure each tuple is enclosed in (). Hope this helps.

  • I believe I found the solution.

    I wanted the Market Share to be calculated based on the common Time dimension. So, I did not create any virtual cube but instead modified the measure in the "Product Sales" cube as

    [Measures].[Amount]/lookupcube("Total","([Measures].[Total],"+[Date].Currentmember.UniqueName+")")

    and this way it gets the Market Total from the "Total" cube based on the selected Time Dimension member.

Viewing 2 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply