Forum Discussion
ckausihan_12
Helper I
5 years agoSum first 3 ranks
Hi, I have a table with students results and I want to sum the top 3 grades. However, a student can have the same subject multiple times with the same result. I am putting the grades into a ranking o...
Anonymous
5 years agoNot applicable
Hello @ckausihan_12
You can test my dax to create calculated columns.
Rank = RANKX (FILTER('Table','Table'[id]=EARLIER('Table'[id])),'Table'[grade],,DESC,Dense)Sum of Top 3 Per Student =
SUMX (
FILTER (
SUMMARIZE (
'Table',
'Table'[student],
'Table'[id],
'Table'[subject],
'Table'[grade],
'Table'[Rank]
),
[id] = EARLIER ( [id] )
&& [Rank] <= 3
),
[grade]
)
The result is as follows:
You can download the pbix file from this link: Add the first 3 ranges
Best regards
Rico Zhou
If this post helps,then consider Accepting it as the solution to help other members find it faster.
ckausihan_12
Helper I
5 years agoHow will this work if there are muktipes of rank 1 or 2? At the moment those duplicates are included in the 'Sum of Top 3 Per Student' calculation.