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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
PBI_quest
Regular Visitor

Top N problem

Screenshot_20220502_174345_com.google.android.apps.docs.editors.sheets.jpg

 ok so I have a matrix that looks like this in powerBI (CATEGORY and CUSTOMER NUMBER are my rows)

 

When i try to filter my customer with top 5 by Total A + B, PowerBI give me 5 customer in one category, 2 in another, etc?

I want my top 5 customers grouped by category if it makes sense

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @PBI_quest ,

 

Here's a simple test to see if this is the result you expect.

 

1 = Rankx('Table','Table'[Value],,DESC,Skip)

 

vhenrykmstf_0-1651734668130.png


If the problem is still not resolved, can you provide screenshots of the test data and the expected results for my further testing? Looking forward to your reply.


Best Regards,
Henry


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

Screenshot_20220506_112136_com.google.android.apps.docs.editors.sheets.jpg

Hi, first of all, thanks for the help!! 

 

I just want to have for each type of mineral the total spent and limit it to the top 5 consumers (order by desc)

 

For info the total is a measure and not a column.

When i try your method it returns 1 for every rank.

amitchandak
Super User
Super User

@PBI_quest ,

 

Rankx(Allselected(Table[Category], Table[Customer]), [Measure],,desc,dense)

 

For the above measure filter rank <=5

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I don't understand what i'm supposed to write for measure filter rank <= 5?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.