Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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
1 ACCEPTED SOLUTION
Mariusz
Community Champion
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

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for the solution!

@Anonymous no problem, happy to help!

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski

 

Mariusz
Community Champion
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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.