Can you highlight an example of where the grand total is wrong? And what you are expecting to see?
The calculation I am using takes Gross Margin/Tons. So for example:
- The Gross Margin Per Ton for BP Toledo Domestic should be Total YTD Gross Margin/Total YTD Tons, in my data it would be -$24,293/35,152 which would equal $0.69.
- I am getting the result of -$60.56 in my data set for the row total of BP Toledo Domestic
The monthly gross margin per ton is correct but the grand totals are not. Let me know if I should explain further.
Your calculation needs to be Sum([Gross Margin])/Sum([Tons]).
Without the Sum() Tableau computes each line in the dataset, which gives you the incorrect answer.
My version is Sheet 2
TEST 2.twbx 75.7 KB
Hi Derek, please change your calculation to
in your current way of calculating it Tableau is doing the math on row level which is not always adequate.
Hope that will help