I would like to calculate sub total in Spotfire cross table based on a condition and color the sub total row.
As shown in the table below, I would like to add sub total
Short Answer is No.
Sub Total and Grand Total is calculated based off the data in the visualization, regardless if you are rendering it or not so it's not "adjustable" without removing / limiting the data via custom expression or filters. The only real way around this would to create a Store named "Sub Total" which contained all of the data for all fruits excluding watermelon. It's not really recommended though.
Here was a similar post on this issue....
https://stackoverflow.com/a/38852432/6167855
https://stackoverflow.com/a/40177511/6167855