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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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
Resident Rockstar
Resident Rockstar

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 👍

Anonymous
Not applicable

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?

Anonymous
Not applicable

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors