The criteria of your DSum uses no variables:
"[Dept] =[Dept] AND [Period] <=[Period] "
For that second [Dept] and [Period] you need to use them as variables and have the data from that record put into the criteria string. You do that by escaping out of the string and concatenating the variable, getting back into the string, escaping out, placing the second variable's value and then finally getting back into the string to close it.
This is what your criteria should be:
"[Dept] ='" & [Dept] & "' AND [Period] <='" & [Period] & "'"