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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.