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
pratima-k
Frequent Visitor

How to find second largest number among 6 numbers using nested if else ?

Need to find second largest number among 6 numbers using nested if else ! if anyone can help that will be great 
 Thanks

4 REPLIES 4
DOLEARY85
Super User
Super User

Hi,

 

does it have to be nested if else, would a measure not work just to find the 2nd largest number:

 

2nd max =
var _max = CALCULATE(MAXX('Table (2)','Table (2)'[Column1]),ALL('Table (2)'))
var _2ndmax = MAXX(FILTER('Table (2)', 'Table (2)'[Column1] <> _max),'Table (2)'[Column1])

RETURN
_2ndmax
 
DOLEARY85_0-1680881862836.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Yes @DOLEARY85 - unfortunately, I need if else, But thanks for your suggestion.😊  

Is the if  else in power query or as a measure/column in report view?

@DOLEARY85 - if else just like power query for example if(a>b && a>c, if(b>c, b, c))

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.