MAXX is weird against TOPN?

scottsen

Well-known Member
Joined
Mar 16, 2014
Messages
1,263
If I execute this:

EVALUATE
TOPN (
COUNTA ( MyTable[MyValue] ) / 2,
ALL ( MyTable ),
MyTable[MyValue],
1
)

I see values come back as the lowest values in my table: 1,1,1,2,2,2. All is good.

And then wrap the same exact TOPN in a MAXX... inside a measure / calculated field...

=MAXX(
TOPN (
COUNTA ( MyTable[MyValue] ) / 2,
ALL ( MyTable ),
MyTable[MyValue],
1
),
MyTable[MyValue]
)

And it comes back with the largest number in my entire table, not just the TOPN. (10 in my test case).

I can't wrap my head around why this would be... can anybody help?
-Scott
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
MAXX Function (DAX)

Evaluates an expression for each row of a table and returns the largest numeric value.
 
Upvote 0
MAXX Function (DAX)

Evaluates an expression for each row of a table and returns the largest numeric value.

Parameters


[TABLE="width: 1496"]
<tbody>[TR]
[TH="bgcolor: #EDEDED"]Term
[/TH]
[TH="bgcolor: #EDEDED"]Definition
[/TH]
[/TR]
[TR]
[TD]table
[/TD]
[TD]The table containing the rows for which the expression will be evaluated.
[/TD]
[/TR]
[TR]
[TD]expression
[/TD]
[TD]The expression to be evaluated for each row of the table.
[/TD]
[/TR]
</tbody>[/TABLE]


TOPN returns the "table" for the first param... no?
 
Upvote 0
I know nothing about DAX but its pretty clear that the intent is to return the Max value, and not the Top 10
 
Upvote 0
In case some crazy person comes across this in the future, this was actually confirmed to be a bug, by Microsoft. Not sure of full scope nor fix time.
 
Upvote 0

Forum statistics

Threads
1,223,993
Messages
6,175,845
Members
452,675
Latest member
duongtruc1610

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