So if you look in the "Number of Records" field that Tableau creates...it's just the number 1...
As you don't have any aggregation in your formula, it is doing a row level calculation...
Budget/1 (which is just the budget)
If you wrap them both in a SUM (say)...so SUM([Budget])/SUM([Number of Records]) then it will Sum them both up at the level of your Viz, and then do the division (just using the aggregation on Budget on Average, rather than the default of SUM would probably do the same thing)
If that's not the problem, and I've missed the point (certainly wouldn't be the first time!) let me know (and maybe with some example data) and I'll have another go!
Hi Simon, thanks a lot for your reply. Problem fixed!