you can't put a custom formula in the header of a group, CR has not 'read'/'calculated' the value yet. The footer is a better place.
If it is absolutely needed in the header, you can create a subreport to calculate the value and display that...though the usual caveats apply, it will read the data (in it's entirety) twice or more, it will make and drop connections to the database as many times as the subreport is called (so if the report has 100 records, the report will pull data from the database 101 times) which will affect performance.