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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
afranci14
Regular Visitor

Ranking DAX within a large Data Model

Hello! Hope everyone answering this or referencing this in the future is having a great day!

 

I have a problem which I will describe below!

 

In one visual, I am trying to rank customers based on 22 commissionable sales by each salesperson in the company. In my current dashboard where the ranking calc is needed, we are looking at every salesperson in the company across all BU's. The first few columns are: Division, Sub-Division, Cons #, Consultant, Cust #, Cust Name, Ship To #, Ship To Name, 7-8 columns of item data, some other sales data , '22 commissionable Sales, '21 Margin Cost, '22 Margin Cost. I want to base the rank off of '22 commissionable sales, By Customer, By Rep. 

 

We have a Customer table containing our customer data (name, #, Contract, GPO, etc...), a sales table with the commissionable sales, Cons #, and Cons Name, and explicit calculations in our expression tables that replicate all of the values in our tables so we can use the values without writing SUM(..) a million times. 

 

I'm struggling with how to give context to the Customer # across a total of commissionable sales for that customer compared to the consultants other customers. Ideally, I'd like the first few columns to look something like what is below, obviously with item data, contract data, other sales data, and '22 commissionable sales data out to the right a bit!

 

DivisionSub-DivCons # Cons NameCust #Cust NameRank
HC 1Al2342Lions4
HC 2Tim523234Tigers16
Home 78

Bertha

25435234Bears3

Home

 78Bertha1234235Oh My!10
HC 3Gertrude86786Jokes inc4
HC 2Tim4658Not Tigers2
HC 1Al76824Another One1
HC 1Al2342Lions4
HC 2Tim4658Not Tigers2

 

Last Request!! I would love for the calculation to show maybe Ranks 1-20 and the have a line for Other, where the row would include the "rest" of the customers that maybe wouldn't be included in the top 20. This would be super nice and if there was a way I could remap our dashboard to make this work, I would happily do so! Even if the dashboard would need to only display one salesperson at a time (with a drop down menu that would allow me to select a different salesperson if wanted or needed), the "other" sub-total of all non top 20 customers for each salesperson would be very helpful.

 

Model changes are possible but our refresh hits at 6am and would probably need to put any changes into a UAT enviro for at least a day. Possible, but not ideal. Looking forward to seeing what the community produces!!

 

2 REPLIES 2
Anonymous
Not applicable

Hi @afranci14 ,

If you want to get the TOP N and others info, you can refer the links below to get it.

Pie Chart - Top 5 - Rest named Other

yingyinr_0-1658739036364.png

Filter top 3 products with a row for others using DAX in Power BI

yingyinr_1-1658739036685.png

DAX Fridays! #132: Dynamic TopN + Others in Power BI

Display Top N items and Others in Power BI

If the above one can't help you get the desired result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Best Regards

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. 
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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