Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

RANK with SWITCH

Hi All, 

 

I have the following SWITCH statement: 

 

Difference = SWITCH( TRUE(),
ISBLANK([Previous Wave]),0,
ISBLANK([Current_Wave]),0,
[Current_Wave] - [Previous Wave])
 
Would it be possible to rank the results of this SWITCH statement? 
 
Thanks,
 
Tom
  • Hi Anonymous 

     

    there is no need to use the switch function, null ( blank ) is 0 and it will work fine when adding numbers and in Rank.

    Please see the below and the attached 

     

    Measure = 
    RANKX( 
        ALLSELECTED( 'Table'[ID] ), 
        [Current Wave] - [Prewious Wave]
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

3 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Anonymous 

     

    there is no need to use the switch function, null ( blank ) is 0 and it will work fine when adding numbers and in Rank.

    Please see the below and the attached 

     

    Measure = 
    RANKX( 
        ALLSELECTED( 'Table'[ID] ), 
        [Current Wave] - [Prewious Wave]
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the solution!

    • Mariusz's avatar
      Mariusz
      Community Champion

      Anonymous no problem, happy to help!

      Best Regards,
      Mariusz

      Please feel free to connect with me.
      Mariusz Repczynski