Forum Discussion
stericontrol
4 years agoRegular Visitor
AVERAGE 3 HIGHEST
Hello! I need to find and select the 3 highest values of each row (amount of products per month) from the table and calculate the average. How could I do this by creating a measure using DAX? ...
- 4 years ago
Hi stericontrol
It'd be better if you share a sample of your data here.
BTW, try this measure:
Top 3 Average = AVERAGEX ( FILTER ( SUMMARIZE ( 'Table', 'Table'[Product], 'Table'[Value], "Rank", RANKX ( ALLEXCEPT ( 'Table', 'Table'[Product] ), CALCULATE ( MAX ( 'Table'[Value] ) ), , DESC, DENSE ) ), [Rank] <= 3 ), [Value] )Output:
Download Link:https://gofile.io/d/4F5FfN
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos ✌️!!
VahidDM
4 years agoSuper User
Hi stericontrol
It'd be better if you share a sample of your data here.
BTW, try this measure:
Top 3 Average =
AVERAGEX (
FILTER (
SUMMARIZE (
'Table',
'Table'[Product],
'Table'[Value],
"Rank",
RANKX (
ALLEXCEPT ( 'Table', 'Table'[Product] ),
CALCULATE ( MAX ( 'Table'[Value] ) ),
,
DESC,
DENSE
)
),
[Rank] <= 3
),
[Value]
)Output:
Download Link:https://gofile.io/d/4F5FfN
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos ✌️!!
MGaribay
4 years agoNew Member
Hello Vahid!
What about if I do want to Avoid filters ?
I mean, if I do add an slicer and filter by product, to not affect average.