Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

RANKX issue while applying filters

Hi  All,

I am facing issue while Calculating Topn 10 + others column using RANKX measure in Azure Cube. My RANKX is not wokring fine if i apply any Filter .

 

I have created below measure and column in Azure cube

 

AM_ManufacturerValueRank = RANKX(ALL('Market Share Fact'[Manufacturer Name]),
CALCULATE(SUM('Market Share Fact'[Online Sales Value]),ALLEXCEPT('Market Share Fact','Market Share Fact'[Manufacturer Name])))

 

TOP10_Others_Column = IF([AM_ManufacturersValueRank]<=10,'Market Share Fact'[Manufacturer Name],"Others")

 

Measure worte in Power BI desktop

 

AM_Rank = RANKX(ALL('Market Share Fact'[Manufacturer Name]),CALCULATE(SUM('Market Share Fact'[Online Sales Value])),,DESC)

 

In Azure Cube  TOP10_Others_Column is populating TOPN + others while using  AM_ManufacturerValueRank  but same is not working fine if i use  AM_Rank measure. And it took lot of time to calculate if i use  AM_Rank measure some time it gives out of memory issues.

 

Could somebody help me to resolve the issue

 

 

Thanks & Regards,

Rajeev

2 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jimmy Tao,

       

      Thanks for your reply,

       

      I would like to implement TOPN + Others in a Pie /Donut chart and my TOP N should be recalculated based of filters applied. 

       

      i worte below RANKX column to calculate TOP N+ Others unfortunaterly this dosent work form me. Please help me if you have implemented this before

       

      RANK_TOPN_Column =
      var MonthRank = RANKX(ALL(financials[Month Name]),CALCULATE(SUM(financials[ Sales])),,DESC)
      return
      if(MonthRank<=5,financials[Month Name],"Others")

       

       I wrote one more colume  to get the TOP N+ others  month names . This calculated colums is not recalculating the new TOPN  + others when ever a filter is applied

       

      RANK_TOPN_Column =
      var MonthRank = RANKX(ALL(financials[Month Name]),CALCULATE(SUM(financials[ Sales]),ALLEXCEPT(financials,financials[Month Name])),,DESC)
      return
      if(MonthRank<=5,financials[Month Name],"Others") .

       

       

      Thanks & Regards,

      Rajeev