This can be done by creating a calculated field similar to the following:
if window_max(sum(Score))=sum(Score) then max(Color) end
Sr. No., Color and Score should be placed on the rows shelf. Then. place the above calculation on the text shelf. Right click on it and select Edit Table Calculation... Click Advanced from the drop down menu next to Compute Using... In the resulting dialog box place the fields in the following order in the Addressing box: Sr No, Color, Score. Click OK. Then, choose Deepest for at the level and Sr No for Restarting every.
Hope this helps!
Thank you Tracy, it worked