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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-stephen-msft
Community Support
Community Support

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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