Hi Sainzmichael,
Welcome to the board! Can you reply with the calculation/xpath that you are using for the function? Also, what's the data source look like? You might want to take a look at the code in the Invoice, Timecard, or Absence Request solutions to see how totals are calculated, but those are all version 1 solutions written in script and SP1 (the latest version) actually has a lot of support for calculations built-in to the designer, so you should be able to do it using xpath.
Cheers,
Patrick Halstead [InfoPath MVP]
InfoPathDev
Patrick Halstead
Project Manager at Qdabra