Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DAX Rankx not working with filter from another table

Hey guys,

I have a bit of, I think, a weird one.   I am trying to create a ranking for the colleagues in our support department based on a series of criteria.  The idea is that I need an overall ranking as well as a filtered ranking when looking at an individual team.  I have gotten the ranking to work with the following Rankx DAX, but when filtering down to a Team (from another table, all of the members not on that team are showing in last place instead of not at all.  Also to note, this all worked perfectly before I needed to separate the Team table out.

 

Ranking Survey = RANKX(ALLSELECTED('Main Query'[Member_ID]),[Survey_Score])

 

When selecting a team, as you can see, all of the ones distplaying a 7 are not on that team.  For some additional information on this, Member_ID comes from Main_Query, Survey Score and Survey Ranking are Measures all calculated from Main Query.

 

Here is what the data model looks like, in order to show why the team needs to be setup this way.

 

Any ideas on what could be causing this to not work like this.  I have tried everything I can think of and find while googling.

 

Thanks in advance

  • Hi,

     

    Try this

     

    =IF(ISBLANK([Survey_Score]),BLANK(),RANKX(ALLSELECTED('Main Query'[Member_ID]),[Survey_Score]))

     

    Hope this helps.

2 Replies

  • Hi,

     

    Try this

     

    =IF(ISBLANK([Survey_Score]),BLANK(),RANKX(ALLSELECTED('Main Query'[Member_ID]),[Survey_Score]))

     

    Hope this helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey,

      Thanks, that worked perfectly and such and easy solution. 

      I guess I was too focused on the rankx, should have thought of that.