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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
rcorn
Frequent Visitor

RANKX value changes for filtered value when it shouldnt

I am using a RANKX formula to rank a category by UPB($). As shown in the screenshot I have two tables, the first table with only the green highlighted category with the rank 8, and the second table with 4 categorys with the green highligheted category being 7. 7 is the right rank for this category as shown in table 2, but when I click the green cateogry in table 2 to filter down table 1 to show only the green category value in table 1 it changes the rank to the wrong rank of 8.

 

This is my rank formula: 

Current Rank =
RANKX(ALL(table[category]),[SUM of UPB($)],,,Skip)
 
Please help me understand why when I click the green category in table 2 (with the right rank) why does that change the rank in table 1 when it should be the same.

 

 

rcorn_0-1681318094273.png

 

3 REPLIES 3
Anonymous
Not applicable

Hi @rcorn ,

 

To avoid this issue, you can modify your formula to use the ALLSELECTED function instead of the ALL function. The ALLSELECTED function returns all the selected values in the current filter context, including any filters applied to the table. Here is the modified formula:

Current Rank =
RANKX(ALLSELECTED(table[category]),[SUM of UPB($)],,,Skip)

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

Thanks for the response, ALLSELECTED will not work in this case as it limits ranking to only the green category in the first table showing rank 1 where I want it to continue to show correct rank of 7 (as shown in table 2)

Having same issue.... Have you solved it?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors