Forum Discussion

birdie29's avatar
birdie29
Advocate II
9 years ago
Solved

RANKX Measure Not Filtering As Expected

Hi Everyone   I'm really struggling with a RANKX measure, which I expect is probably simple but I just can't figure it out :(   Essentially I want a 'Flexible' ranking of projects by their 'tcv',...
  • Sean's avatar
    9 years ago

    birdie29 Try changing ALL to ALLSELECTED :smileyhappy:

     

    EDIT: Actually you may have to use the column...

    Rank =
    RANKX ( ALL ( 'Total Projects'[Project.Project ID] ), [tcv],, DESC, SKIP )
  • v-micsh-msft's avatar
    9 years ago

    Hi birdie29,

     

    As Sean suggested, replace All() with AllSelected () should make it work.

    "

    The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.

    "

    Which means Visuals would work on the data which has been selected in the Visual.

    Reference: ALLSELECTED Function (DAX)

    In addition, please also take a look at the following blog, regarding RankX:

    DAX RANKX function scenarios

    Regards

  • v-micsh-msft's avatar
    v-micsh-msft
    9 years ago

    Hi birdie29,

     

    If you would like to select 'Project.Project Status' and have the rankX to work with it, then we might need to add the 'Project.Project Status' into the ALL function.

    For the Rank 2, to hide the rows which have no value in [Tcv], take use of the Visual Level filter to remove the blank values of [tcv]:

    Regards