Forum Discussion

Nats_17's avatar
Nats_17
New Member
1 year ago
Solved

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:


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


something weird happens:

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.






  • Anonymous's avatar
    Anonymous
    1 year ago

    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

     

    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

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

     

    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