that is absolutely possible. but your sum must be based on any Group(ing)
you can create query as specified in this thread.
then after creating query you have two options
1) drag that query directly to any form and use it
or
create a view based on your query and use it that view as DS of form