Forum Discussion
Anonymous
7 years agoNot applicable
Return second biggest value
Hi! I am looking for a formula that will return the second biggest value. Below is the formula that is returning me the biggest value from a certain dataset: LAstMonth =
CALCULATE(
SU...
- 7 years ago
Anonymous
Try following measure
SecondLAstMonth = SUMX ( TOPN ( 1, TOPN ( 2, VALUES ( Q1_Subledger[Source.Name] ), [Source.Name], DESC ), [Source.Name], ASC ), CALCULATE ( SUM ( Q1_Subledger[Amount incl VAT] ) ) )
Zubair_Muhammad
7 years agoCommunity Champion
Anonymous
Try following measure
SecondLAstMonth =
SUMX (
TOPN (
1,
TOPN ( 2, VALUES ( Q1_Subledger[Source.Name] ), [Source.Name], DESC ),
[Source.Name], ASC
),
CALCULATE ( SUM ( Q1_Subledger[Amount incl VAT] ) )
)