well, to confuse you more this has to do with when data passes occur.
Summaries like a your DISTINCTCOUNT and your SUM occur after record selection but before group selections. So it is doing the DistinctCount before it omits the groups. YOu can fix this pretty simply by using a Running Total instead.
Create a Running Total as
Name='DocumentCount' (or whatever you want)
Field to Sumamrize=Profile.Docnum
Type=DistinctCount
Evaluate=Use a formula
Reset=Never
Place in the report footer.
RT's do not work in headers (again based on the sequence of data pass an).