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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Nats_17
New Member

Problem with RANKX while applying top n in filter pane

Hello!
I'm experiencing some trouble with my report. I have the following measures:

Total Gross Profit = SUM(Dane[Order Gross Profit])

and

Subcategory Rank =
RANKX(
    ALL(Dane[Subcategory Name]),  
    [Total Gross Profit], 
    ,
    DESC 
)

when i create a matrix visual with all subcategories, the ranks are correct, as shown below:
Nats_17_0-1736552150696.png


However when i go to the filter pane and filter subcategories to top 5 by total gross profit:

Nats_17_1-1736552216517.png


something weird happens:

Nats_17_2-1736552240923.png

I would like to see subcategory rank as before applying the top n filter.
I have no idea how to fix it and would really appreciate some support.






1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @Nats_17 ,
Thanks for Ashish_Mathur reply.
Here is another way to troubleshoot this

You can use the ranked MEASURES as a basis to get the top five profits, as shown below, and you can display the last five figures in sub-sort order

vheqmsft_0-1736745899192.png

 

If you still can't solve the problem, you can provide the full example data so we can help you faster. Please hide sensitive information in advance.

 

Best regards,
Albert He


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

 

View solution in original post

2 REPLIES 2
v-heq-msft
Community Support
Community Support

Hi @Nats_17 ,
Thanks for Ashish_Mathur reply.
Here is another way to troubleshoot this

You can use the ranked MEASURES as a basis to get the top five profits, as shown below, and you can display the last five figures in sub-sort order

vheqmsft_0-1736745899192.png

 

If you still can't solve the problem, you can provide the full example data so we can help you faster. Please hide sensitive information in advance.

 

Best regards,
Albert He


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

 

Ashish_Mathur
Super User
Super User

Hi,

In your measure, change ALL to ALLSELECTED


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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