You should look into the Dimensionality() function. In a pivot table, the total line should have dimensionality() = 0, while your other lines should be 1 or greater.
So, use something like:
=if(Dimensionality() = 0, TotalExpression, Null)
I'm not sure if this will actually allow you to hide the extra expression. I have used it to display a different expression in the total line, but I always had the same number of expressions in the body and totals. I tried this on a quick test and the results were all null, but the line still showed up.