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

How to find top N and remaining to be others

Hi Team,

 

From the following data i need to create a top 7 sales items and remaining should be keep it as others.Please let me know what is the formula to calcualte this.

 

ItemSales
pepsi25000
coc15000
macintosh5800
cadburry2500
7up1500
dew4500
expresso6900
oreo4500
Almond t450
cool bites1250
abc bis4560

 

Expected output

pepsi25000
coc15000
expresso6900
macintosh5800
abc bis4560
dew4500
oreo4500
others5700
1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

the only way I know to do this is to create a calculated column, grouping the non top 7 into 'others' bucket

Item2 = 
VAR ItemRank = RANK.EQ('Table'[Sales],'Table'[Sales])
RETURN
IF(ItemRank<=7,'Table'[Item],"other")

EDIT - syntax 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

the only way I know to do this is to create a calculated column, grouping the non top 7 into 'others' bucket

Item2 = 
VAR ItemRank = RANK.EQ('Table'[Sales],'Table'[Sales])
RETURN
IF(ItemRank<=7,'Table'[Item],"other")

EDIT - syntax 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

@Stachu thank you for the reply.I just got it by using the same lofic by using the RANKX function,

 

Thank you.

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.