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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SinaA
Frequent Visitor

Ranking System Error

I have a question regarding ranking salespeople based on their total sales across different cities using DAX. I'm aiming to have a consistent ranking for each salesperson, regardless of any filters applied. Currently, my ranking system functions correctly when filtering by year or city. However, I've noticed that the ranking changes when I filter for a specific salesperson. For instance, Person A is ranked 34 overall, but when I apply a filter to only display Person A, their rank changes to 21. I'm using the following DAX code:

 

Rank = RANKX ( ALL('SinaA'[Name]), CALCULATE (SUM('SinaA'[Sales]), ALLEXCEPT(SinaA, SinaA[Name],SinaA[City], SinaA[Year])), , DESC, Dense )

 

Could you provide some guidance on why this might be occurring and how to maintain a consistent ranking, regardless of the filter applied?

 

Thanks!

5 REPLIES 5
jiaopengzi
Frequent Visitor

You can use the new function: RANK
to see if it is what you want, the first picture is unfiltered, and the second picture is added with a slicer filter

 

_RANK = RANK ( DENSE, ALL ( Sales ), ORDERBY ( [Sales], DESC ) )

 

jiaopengzi_0-1683773306723.png

 

jiaopengzi_1-1683773335965.png

 

 

 

I appreciate your suggestion. However, I would like to rank salespeople (A, B,....) based on their total sales. Additionally, I would like to rank them when filtering for City or Category. 

Thanks!

You can simulate a result. I don't quite understand what you mean.

eliasayyy
Memorable Member
Memorable Member

is it possible to share some sample data please?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.