Search code examples
ssasmdxanalysisservices

to select top MAX 10 measure in mdx


I am trying to select top max 10 measure in MDX and I get this ,what I have to do to get top 10 max.

     With
    Set [Top10] AS
    (TOPCOUNT({ORDER( ({[Customer].[Customer State]})
     ,([Measures].[Customers Quantity]),BDESC)},10))
    Select
    [Measures].[Customers Quantity] on Columns,
    {[Top10]}  on Rows
    From
    [DW Brazillian Ecommerce]

and I get this

enter image description here

I know what I did is wrong so what is the accurate query to get top 10 max customer quantity??


Solution

  • Change [Customer].[Customer State] to [Customer].[Customer State].[Customer State].Members. In the current expression you are just ranking the grand total. This change fixes the problem.