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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
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 👍

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.