Calculating percent with sums
Posted on 2012-03-16
I'm trying to calculate the remaining money in the budget left in dollars and percents and I'm getting no where fast. I'm calculating the actual money spent with
=SUM(Fields!Labour.Value) + SUM(Fields!Expenses.Value)
and the remaining $ amount with
=Fields!Budget.Value - (Sum(Fields!Labour.Value)+ SUM(Fields!Expenses.Value))
but I'm getting wierd results when I try to get a %.
I've formated the text box to display as a % so all I should have to do inside is take the remaining $ and divide by the budget to get the remaining as a percent. To do this I've had to use
= (Fields!Budget.Value - (Sum(Fields!Labour.Value)+ SUM(Fields!Expenses.Value))) / Fields!Budget.Value
Is there no way I can access the value of the textbox instead? I tried ReportItems.txtRemaining.value but I got an error when I ran the report. Is there a more elegant way to code this? Maybe I should have done it in the query?