title: RANKING Function in DAX or MDX
body: <p>How can i get result in attached image by DAX or MDX.Both can work for me.
  ( I will use DAX in Tabular Model and Will use MDX on SSRS part).</p>
  
  <p>Sample Format
  <img src="https://i.stack.imgur.com/zikMV.png" alt="Sample Format"></p>
  
  <p>I tried below code but it didn't work.</p>
  
  <pre><code>WITH 
    SET OrderSet AS 
      Order
      (
        (
          [Dim Product].[Category Name].[Category Name].MEMBERS
         ,[Dim Product].[Subcategory Name].[Subcategory Name].MEMBERS
         ,[Dim Product].[Sub Subcategory Name].[Sub Subcategory Name].MEMBERS
         ,[Dim Product].[Product Name].[Product Name].MEMBERS
        )
       ,[Measures].[Order Quantity]
       ,BDESC
      ) 
    MEMBER [Measures].[RankOrderCount] AS 
      Rank
      (
        (
          [Dim Product].[Category Name].CurrentMember
         ,[Dim Product].[Subcategory Name].CurrentMember
         ,[Dim Product].[Sub Subcategory Name].CurrentMember
         ,[Dim Product].[Product Name].CurrentMember
        )
       ,OrderSet
      ) 
  SELECT 
    {
      [Measures].[Order Quantity]
     ,[Measures].[RankOrderCount]
    } ON 0
   ,NON EMPTY 
      {OrderSet} ON 1
  FROM [Adventure Works DW2016CTP3];
  </code></pre>