Reputation: 26897
If I have a table (tablix) in SSRS, and one of the columns is a simple expression:
=Fields!NumPorts.Value - Fields!PortsUsedLastQuarter.Value
Then how can I add a "total count" column for this? I can't add a total column, it's greyed out because it's an expression and not a simple field.
Thanks
Upvotes: 4
Views: 20738
Reputation: 4617
why not try with =Sum(Fields!NumPorts.Value - Fields!PortsUsedLastQuarter.Value)
as the add total
If it doesn't work then:
First you can try with some field value that doesn't show it the greyed out, then change the value of the column back to your expression
=Fields!NumPorts.Value - Fields!PortsUsedLastQuarter.Value
and the "add total" cell to the expression:
=Sum(Fields!NumPorts.Value - Fields!PortsUsedLastQuarter.Value)
HTH
Upvotes: 3
Reputation: 23789
There are a few different ways to do this. I think the most general purpose way is:
Right click on the grouping that you want to total. Sound like in your case this will be the details group. (You can find a list of groups in the Row Groups pane of the designer window.
Select "Add Total -> Before" (or after)
You should now have a row to add the totals into. SSRS tries to figure out what totals to insert. If those are appropriate, leave them, but in your case we will need to edit the expression of a cell.
In the cell you want your total, right click and select Expression. (The same process could be followed for a placeholder in the cell as well.)
In the Expression window, Enter =SUM(Fields!NumPorts.Value - Fields!PortsUsedLastQuarter.Value)
Upvotes: 5