Have you tried to define this as a calculated measure in the cube itself?
If you use your student_dimension ID as a measure in the cube (call it Distinct_nbr).
In the property definitions in the cube, selct distinct count instead of sum.
This distinct count will hopefully give you a distinct count over all dimensions.
You have probably already solved this question, since you asked in already in April, but I am new to this forum so I have to see how it is functioning.