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

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

Reply
m_wex
Helper I
Helper I

Filtered Rank Problem

Have created a standard ranking, which is working fine, using the following: Customer Ranking = rankx(all ('Customer Data'[Sold-to Party Group]),[CY Total Sales],,desc).

 

I am working on a customer profile page where the filter is Sold-to Party Group (field used in the above formula). I am trying to return a simple card showing the customer's rank of all customers. The problem is that the rank is incorrect when using the above formula on the page filtered by customer group. The 2nd ranked customer shows as 3.

 

I am pretty sure the problem is being caused by the page's selection criteria (Sold-to Party Group). 

 

Any help woould be greatly appreciated.

 

 

3 REPLIES 3
m_wex
Helper I
Helper I

Looking at the problem more closely it appears to be isolated to the overall customer group ranking. I am trying to accomplish two goals: Show the customer's rank by year and then their rank based on total sales. The rank by year is correct but not the overall. The correct answer in the example below for rank based on all sales is 2.

 

In addition to showing ranking on a table I am also trying to show the overall rank (without year filter) on a seperate card. There is only one filter on this page at it is sold-to Party Group. The dax for the customer ranking is: 

 

Customer Ranking 2 = if(HASONEFILTER('Customer Data'[Sold-to Party Group]),rankx(all('Customer Data'[Sold-to Party Group]),[CY Total Sales],,desc))

 

 

Rankx problem.jpg

tamerj1
Super User
Super User

Hi @m_wex 

please try

Customer Ranking = rankx(allselected('Customer Data'[Sold-to Party Group]),[CY Total Sales],,desc).

Hi tamerj1, thank you. Before the customer was ranked at 3. With the new formula they are ranked at one. The correct value is 2. What I am ultimately trying to create is a card showing the customer's unfiltered rank.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.