I am assuming a formula can only return one type of variable/ Class (integer, currency, text etc) as I am getting an error using the following formula

All of the numbers produced by the formula is correct however the top 3 units are currency however units sold need to be a general number. This is why i try casting it to a general number. This cast does work when placed in the context of a tile visual. However when i place it on a graph it causes an error in which no data appears.

what would be causing this?

Thanks for any suggestions,