DAX nth largest value

dicken

Active Member
Joined
Feb 12, 2022
Messages
287
Office Version
  1. 365
Platform
  1. Windows
Hi,
Is there a way of getting the nth largest value using DAX, something like LARGE in excel or list.firstN ( list, count ) {x} ?

Richard
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Maybe you are looking for TOPN?
 
Upvote 0
Maybe you are looking for TOPN?
Well I wasn't aware of TOPN, so thanks for that but no,
if I put

mmax:=MAX(Table1[Sales])

as a measure I get the max value, but I want the second highest value,
not the top two and not a table which is was TOPN returns



EVALUATE
TOPN ( 2, Table1, Table1[Sales] )

Gigi 3933 RRP
Tom 4831 ABC

Richard
 
Upvote 0
Hi, I meant like this.

Book1
BCDEFGHIJKL
1
2
3Sales RepAmountProductRow Labels2ndLargest
4Gigi3933RRPABC$4.831
5Tom4831ABCRRP$2.674
6Dirk5873ABCGrand Total$2.393
7Paula2393ABC
8Jody1564RRP=Maxx(TOPN(2;Table1;[Amount];ASC);[Amount])
9Miriam2674RRP
10Ian4021RRP
11
Sheet1
 
Upvote 0
Sorry, max should be min obviously. I must have been distracked this morning.
If TOPN returns a table, one can get min from that table.
 
Upvote 0
Sorry, max should be min obviously. I must have been distracked this morning.
If TOPN returns a table, one can get min from that table.
You've used semi colon , I've never used them except in excel ,( rows, column) , I can see what it's supposed to do but have yet to get a value returned ? I've tried MIN( TOPN(2, Table1), Table1[Value]) , but this doesn't work.

RD
 
Upvote 0
Yes, I'm on EU settings, so my ";" is your ",". I usely do think to update it, but not always.
Did you try with MINX?
 
Upvote 0
Yes, I'm on EU settings, so my ";" is your ",". I usely do think to update it, but not always.
Did you try with MINX?
Oh, thanks, I didn't know that, so thanks for letting me know that, so in excel
in a formula like
Excel Formula:
  COUNTIFS(B2:B11,{"hoodie","Shirt"},C2:C11,{"S";"L"})
would the ; and , be the other way round?
I've not got the nth smallest , largest working yet, if i do I'll let you know.

Richard.
 
Upvote 0
And cross-posted (again):
 
Upvote 0

Forum statistics

Threads
1,216,349
Messages
6,130,133
Members
449,560
Latest member
mattstan2012

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top