Maybe something like this will work
Var1=Max([Number In ([R Month]))
Var2=Profit where ([R Number]=Var1)
You may have to play around with the contents a bit. For example,
Var1=Max([Number In ([R Year];[R Month]))
You can also try the In () outside the Max()
Var1=Max([Number) In ([R Year];[R Month])
You can also try using Var1 as a filter for the table.