Tableau's totals are not an aggregation of the displayed marks, they are the same computation (your calculated field) performed separately at a higher level of aggregation. In the Grand Total for a column, it's as if all the dimension pills on Rows are removed, so the computation is happening across most/all of your data source. If you want the Grand Total to be an aggregation like the sum of the displayed marks, then you'll need to use a workaround (there are several). This series of posts beginning with http://drawingwithnumbers.artisart.org/customizing-grand-totals-part-1/ goes through the variations.
Hi, regardless of the subtotals and grandtotals my formula doesn't seem to be working as it is counting everything rather than what is > 0, Sales Rep is the lowest level in the Hierarchy.
I need to get the distinct number of reps who have sales > 0
I'm not sure of all the details of how your data is laid out. Please post a packaged workbook with some sample data that represents your situation, see this post for details: http://community.tableau.com/docs/DOC-1476.