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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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