Forum Discussion
rquizon09
1 year agoFrequent Visitor
Exam Item Analysis
Hi, Newbie here. How can I sum the Item No.1 based on the Score Column. But before to get the SUM of Item No. 1, I need to Sort Descending order the Score Column because I need only those top N ...
bhanu_gautam
Super User
1 year agorquizon09 , Try using below steps
First, sort your data by the Score column in descending order.
Create a calculated column to rank the scores. You can use the RANKX function for this.
Rank = RANKX(ALL('YourTable'), 'YourTable'[Score], , DESC, DENSE)
Filter Top N and Bottom N:
TopN_Sum =
CALCULATE(
SUM('YourTable'[Item No.1]),
FILTER(
'YourTable',
'YourTable'[Rank] <= N // Replace N with the number of top scores you want
)
)
Combine the Measures:
Create a final measure to sum the values from the top N and bottom N.
Total_Sum = [TopN_Sum] + [BottomN_Sum]
Add a card or any other visual to display the Total_Sum measure.