How can I display a totals heading in SSRS when there is a column grouping? (It should appear on just the last item in the group)
<p>I'm trying to include some text for a heading at the bottom of a column in an SSRS report, but the problem is that the heading is being repeated for every group item in the column, but I only want it to appear in the last one.</p>

<hr>

<p>To give an example, imagine a report that should look something like this:</p>

<pre>
Day   |     Company     | Total Income
       TestInc  OtherLtd
Mon      £5        £9          £14
Tue      £4        £4          £8
Wed      £8        £2          £10
                 Total:        £32
</pre>

<p>The raw data comes from a SQL table that has entries for each transaction for each company. The report groups the transactions by day for each row, and then by company for the columns. There could be many more days, and many more companies to be shown.</p>

<p>The total income column shows the totals for each row. (So the total income on any given day). And the final total at the bottom is the total income for the all companies and all days.</p>

<p><sub>(This is a slightly contrived example just to simplify for the purposes of the question, so it may seem like I can just alter the layout to fix the problem, but in reality that isn't an option)</sub></p>

<p>My problem is with the positing of the "Total:" text. It's in a cell which is in the column group, so currently it is appearing like this:</p>

<pre>
Day   |     Company     | Total Income
       TestInc  OtherLtd
Mon      £5        £9          £14
Tue      £4        £4          £8
Wed      £8        £2          £10
       Total:    Total:        £32
</pre>

<p>I've tried using an expression for hiding the cell like this:</p>

<pre><code>=IIf(Fields!CompanyId.Value = Last(Fields!CompanyId.Value, "Companies"), False, True)
</code></pre>

<p>But the 'Last' function seems to return the value from the last row in the query result, rather than the last company in the group which is what I need to check against.</p>

<p><strong>Is there any way I can have a cell in a column group, that isn't actually a part of the grouping and only appears at the end? Or failing that, some improved expression that lets me hide it for all but the last column in the group?</strong></p>