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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
schaetzles
Frequent Visitor

PowerBI Rankx very slow

Hey guys,
I have performance issues with the Rankx function.

Currently, i use the rankx function for a dynamic top n selection for a matrix with a slicer.

This works fine for a table with less than 200 customers.
However, if i use my table with 15000 customers, the matrix will not load.

I would be really glad for suggestions or workarounds.



The DAX for my rankx function is the following:

 

 

 

 

Rank__Customer = RANKX(ALL(Customer[CustomerName] ),[TotalSales])

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @schaetzles ,

 

If the customer table only has the customername column.

 

 

new table = distinct(cusotmer[customername ])

 

 

If not, it is recommended to create a new table with only customername column, then link the new table with the customer table, and replace the customer table in your formula with the new table.

 

 

Rank__Customer = RANKX(ALL(new table[CustomerName] ),[TotalSales])

 

 

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @schaetzles ,

 

If the customer table only has the customername column.

 

 

new table = distinct(cusotmer[customername ])

 

 

If not, it is recommended to create a new table with only customername column, then link the new table with the customer table, and replace the customer table in your formula with the new table.

 

 

Rank__Customer = RANKX(ALL(new table[CustomerName] ),[TotalSales])

 

 

 

Best Regards,

Jay

amitchandak
Super User
Super User

@schaetzles , if you are doing dynamic TOPN, then use TOPN

 

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

 

TOPN: https://youtu.be/QIVEFp-QiOk

 

Also, is total sales is a simple measure?

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

Thanks for the answer! 
Total Sales is just a simple measure. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.