Forum Discussion

ViralPatel212's avatar
ViralPatel212
Resolver I
2 years ago
Solved

RanX values changes when Filter is applied

Hi Team.

 

Hoping you could help. I am trying to create a measure that works dynamically with other filters.

As you can see when no filter is selected the ranking works. The ranking is based on the Sum of Size based on Dealer.

However when a filter is applied in this case "Venue" the ranking sort does not work.

End game is that if any filter is applied the ranking should rank the volume including the filters. 

 

Measures:

Dealer Ranking Number 2 =

 IF( [Ranking Size (Vol)] = blank(), BLANK(), RANKX(ALL('Dealer Ranking'[Counter Party]),[Ranking Size (Vol)],,DESC))
 
Ranking Size (Vol) =
    CALCULATE([Ranking Size], 'Dealer Ranking'[Type] = "Vol. (MM)")
Ranking Size =
    SUMX('Dealer Ranking','Dealer Ranking'[Size])
 
thank you
 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi ViralPatel212 

     

    After my tests I came to the conclusion that Function ALL ignores filters applied to tables.

     

    You can remove ALL from the formula.

    IF( [Ranking Size (Vol)] = blank(), BLANK(), RANKX('Dealer Ranking'[Counter Party],[Ranking Size (Vol)],,DESC))

     

    For more information about the ALL function, you can refer to the following documentation: ALL function (DAX) - DAX | Microsoft Learn

     

    Best Regards,
    Community Support Team _Yuliax

     

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

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ViralPatel212 

     

    After my tests I came to the conclusion that Function ALL ignores filters applied to tables.

     

    You can remove ALL from the formula.

    IF( [Ranking Size (Vol)] = blank(), BLANK(), RANKX('Dealer Ranking'[Counter Party],[Ranking Size (Vol)],,DESC))

     

    For more information about the ALL function, you can refer to the following documentation: ALL function (DAX) - DAX | Microsoft Learn

     

    Best Regards,
    Community Support Team _Yuliax

     

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

    • ViralPatel212's avatar
      ViralPatel212
      Resolver I

      Thanks for that. I realised that i had a visual filter and then everything worked! 

       

    • ViralPatel212's avatar
      ViralPatel212
      Resolver I

      jdbuchanan71 i have tried that but the ranking is not starting from 1 but its starting from 2 and duplicated. See below: