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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
heygowtam
Helper II
Helper II

Get a Second maximum value From COlumn

I have a Table of three Columns 

DateSeasonBottles
14/12/20201916
12/08/20201921.4
11/06/20212064
11/08/20212151
5/11/20212114
10/10/20222215.3



1) Sum the Bottle quantity by Season number then 

 

2) I need to Find the Difference From

---Calculate(SUM[Bottles]  WHERE  season = MAX[season]  - SUM[Bottles ] WHERE season =  SECONDMAX [season])

My question is

If i want Selelct Maximum Value - Max[season],

How can i select  second MAX value 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Please show the expected result clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
VahidDM
Super User
Super User

Hi @heygowtam 

 

Use this DAX expression to find the Second Max date:

Second Max = 
Var _Max = MAX( 'Table'[Date] )
return
CALCULATE(MAX( 'Table'[Date] ),REMOVEFILTERS('Table'),'Table'[Date]<_Max)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

@VahidDM 
Thanks for your Reply, 

I need to pick second highest Season value, 
then subtract from first maximum [Season ] Value, 

 

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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