Forum Discussion

kobkabnaja's avatar
kobkabnaja
Helper II
1 year ago
Solved

Create one filter to get two rank

Hi community,

 

I am creating a comparison dashboard for two state,  following this link (https://www.youtube.com/watch?v=vzI9T3Wdpak&t=300s). The dashboard uses MAX and MIN values to filter two values for the card. I successfully follow the tutorial, but I am trying to extend it by showing the rank of both selected states. When I set the MAX (TEST), I get the correct rank. However, when I set the MIN (TEST2), the ranks for both states disappear. Ideally, I want to show both selected ranks at the same time (please see the attached).

 

Any suggestions or edits to fix this would be greatly appreciated!

 

Thank you,
K.

 

Only one state selectedRanks disappear when two states selectedValue for the first stateValue for the second stateLabel for the first stateLabel for the second stateTry to get a rank for the first stateTry to get a rank for the second state

  • kobkabnaja This is how should address this, use Rank 1 and Rank 2 in the visual, Tweak the solution as  you see fit.

     

     

     

    Rank Measure = 
    RANKX (
       ALL ( 'migration'[Name] ),
       CALCULATE ( SUM ( 'migration'[NETFLOW_TOT] ) ),
       ,
       DESC
    )
    
    Rank 1 = 
    VAR __Max = MAX ( 'migration'[Name] ) 
    RETURN
    CALCULATE ( 
       [Rank Measure],
       'migration'[Name] = __Max 
    )
    
    
    Rank 2 = 
    VAR __Min= MIN( 'migration'[Name] ) 
    RETURN
    CALCULATE ( 
       [Rank Measure],
       'migration'[Name] = __Min
    )
    

     

3 Replies

  • kobkabnaja This is how should address this, use Rank 1 and Rank 2 in the visual, Tweak the solution as  you see fit.

     

     

     

    Rank Measure = 
    RANKX (
       ALL ( 'migration'[Name] ),
       CALCULATE ( SUM ( 'migration'[NETFLOW_TOT] ) ),
       ,
       DESC
    )
    
    Rank 1 = 
    VAR __Max = MAX ( 'migration'[Name] ) 
    RETURN
    CALCULATE ( 
       [Rank Measure],
       'migration'[Name] = __Max 
    )
    
    
    Rank 2 = 
    VAR __Min= MIN( 'migration'[Name] ) 
    RETURN
    CALCULATE ( 
       [Rank Measure],
       'migration'[Name] = __Min
    )