The $ signs are a little peculiar, but it seems that the formatting is 'lost' when the variable expands, although I can't say why. I suggest that you experiment with the format settings on the Number tab of the chart/table properties. Do you have "expression default" checked for this expression?
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
I have tried the expression in a new pivot table and get the same problem
The pivot table is set to Expression Default when the problem occurs, but if I change it to an integer or Fixed decimals, I get values again. I would like to just change the formatting on the number tab, but as 1 of the if statements requires a different formatting from the others, I can not set them all to the same format
Thank you for your suggestions. For now, I have referred back to my original expression and am not using the variable at the present time