Forum Discussion
Second top value
- 4 years ago
Anonymous , Try these measures
Rankx = ankx(allselected(Table[Category]), [sales],,desc,dense)
You can use visual level filter Rank =2 (<category should be replaced with your rank column> should be in visual)
or create a measure on top of that
2nd Rank sumx(filter(values(Table[Category]), [Rank] =2), [Sales])
- 4 years ago
Hi,
I am not sure how your data model looks like, but please check the below picture and the attached pbix file.
I tried to create a sample pbix file like below.
One of ways to check the second top value is, MAX function can be still utilized to find second top value when the first MAX value is filtered out.
Value total: = SUM( Data[Value] )Value first max: = VAR _condition = CALCULATE ( MAX ( Data[Value] ), ALL ( Data[Category] ) ) = [Value total:] RETURN DIVIDE ( _condition, _condition ) * [Value total:]Value second max: = VAR _condition = CALCULATE ( MAX ( Data[Value] ), FILTER ( ALL ( Data[Category] ), [Value total:] <> [Value first max:] ) ) = [Value total:] RETURN DIVIDE ( _condition, _condition ) * [Value total:] - Anonymous4 years ago
Anonymous , Try these measures
Rankx = ankx(allselected(Table[Category]), [sales],,desc,dense)
You can use visual level filter Rank =2 (<category should be replaced with your rank column> should be in visual)
or create a measure on top of that
2nd Rank sumx(filter(values(Table[Category]), [Rank] =2), [Sales])
- Anonymous4 years agoNot applicable
Hi amitchandak,
Thank you very much for your quick response
that one solved my issue
regards,
dsmitha