Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

 Capture.PNG

 

Thanks & Regards,

Rajeev

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi rajeevbikkani,

 

Could you share some sample data or table structure for further analysis?

 

Regards,

Jimmy Tao

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")

 

TOPN Others.PNG

 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") .

 

TOPN Others.PNG

 

Thanks & Regards,

Rajeev 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.