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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

RankX help

I've tried a number of solutions reading through these forums and have learned quite a bit. But I'm still struggling with this particular Ranking. Here is a sample of what my data looks like.

 

sup_namCount of ReasonMonth Name 3
Manager 116January
Manager 112February
Manager 211January
Manager 221February
Manager 3 20January
Manager 3 15February

 

When I apply the rank using a filter for one month I get the rank I'm looking for.

 

Filtered JanCount of ReasonRank
Manager 212January1
Manager 116January2
Manager 320January3

 

However when I have multiple months selected I get where each Manager is ranked for each month instead of being ranked by the total reasons.

 

Filtered Jan & FebCount fo ReasonRank
Manager 211January1
Manager 112February2
Manager 315February3
Manager 116January4
Manager 320January5
Manager 221February6

 

Here is my measure; 

 

RankingMeasure =
IF (
    ISFILTERED ( 'Manager Totals By Month'[Month Name 3] ),
    RANKX (
            ALLSELECTED ( 'Manager Totals By Month' ),
            CALCULATE ( SUM ( 'Manager Totals By Month'[CountofReason] ) ),
            ,
            asc
     ),
    RANKX (
            ALL ( 'Manager Totals By Month' ),
            CALCULATE ( SUM ( 'Manager Totals By Month'[CountofReason] ) ),
            ,
            asc
    )
)
 
 
 
Thanks for all the previous help and the help on this.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

How about this:

RANKX = 
IF ( 
    HASONEVALUE( 'RankX Help'[sup_nam]),
    RANKX( 
        ALL('RankX Help'[sup_nam]), 
        [Total Count of Reason],,ASC,Dense
    )
)

Looks like it produces what you are after:

Table with No Month Filteres.pngTable with Month Fitlers.png

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

I forgot to add what I'm looking for. I'm looking for the ranking on all the totals for each manager for the selected months. Such as Jan & Feb selected;

 

Manager 128N/A1
Manager 232N/A2
Manager 335N/A3
Anonymous
Not applicable

How about this:

RANKX = 
IF ( 
    HASONEVALUE( 'RankX Help'[sup_nam]),
    RANKX( 
        ALL('RankX Help'[sup_nam]), 
        [Total Count of Reason],,ASC,Dense
    )
)

Looks like it produces what you are after:

Table with No Month Filteres.pngTable with Month Fitlers.png

Anonymous
Not applicable

In your example is [Total count of Reason] a new measure? I'm having trouble replicating your formula, when I try to type in that particular field does not pop up.

 

Eample1

Anonymous
Not applicable

Nevermind on my last post. Got it created new measure summing Count of reason. Was having troubl of rank showing all 2's but swapped count of reason out for for my new measure and it perfectly. 

 

Thank you so much Nick!!

Anonymous
Not applicable

Yes, sorry about that, it was a new measure. If you do not use a measure there you need to be sure to use CALCULATE in the expression in order to invoke context transition. If not you will get the same values! I like to use measures since 1) I may be able to use them else where, 2) If i have to make a change, just have to make it once and 3) using a measure has an implied calculate wrapped around it, so don't need to work.  

 

Glad it helped!

Anonymous
Not applicable

The tip regarding measures is great. I like all the points you listed. I will definitley have to start using them more.

 

Thanks again!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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