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
Pikachu-Power
Post Prodigy
Post Prodigy

Top 5 with cut in 5 Rows

Hi all,

 

When I use the filter Top 5 for a table it can happen that I get 7 or more rows because of equal values. But After 5 Rows I want a cut. Example:

 

Company  Values

AB              40

CB              35

DE              30

DS              20

FR              10

--------------------------------------

GH             10

ST              10

 

I tried RANKX to get an Index 1,2,3,4,5 and filter that but seems not to be so easy 😕 

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Pikachu-Power ,

 

We can create an auxiliary column to meet your requirement.

 

1. Create a column to distinguish the same value.

 

sort condition = RANKX('Table','Table'[Company],,ASC,Dense) * 0.0001 + 'Table'[Values]

 

Top5 1.jpg

 

2. Then we can use the column to get the top 5 value. Filter the company’s Top N and put the [sort condition] column in By value.

 

top 5 2.jpg

 

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hi @Pikachu-Power ,

 

We can create an auxiliary column to meet your requirement.

 

1. Create a column to distinguish the same value.

 

sort condition = RANKX('Table','Table'[Company],,ASC,Dense) * 0.0001 + 'Table'[Values]

 

Top5 1.jpg

 

2. Then we can use the column to get the top 5 value. Filter the company’s Top N and put the [sort condition] column in By value.

 

top 5 2.jpg

 

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thats what I find and tried at first 😕 I have no dates like radacat and no index like enterprisedna. and duplicates values dont work in my case. no other way?

 

I think that duplicates values dont work in my case because i have have date instead of value and use

Total Value = COUNT( Rank_tbl[Dates] ). for duplicates values i get blank.

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.