SQL SQL query ssrs report : I have 
period    balance
1         100
1         200
2         300
2         400  
3         400
3         500
i need to show in SSRS report like below
I like to calculate sum if max period as column maxsum
then sum based on second max which is 2
3      2       1
900    700     300
thanks


