Why are using SUM here...it is not very clear to me
This is in reference to calculating the GM%
Hi Gourab,
If we don't use the SUM function we are not calculating a total for 'Gross Profit' and 'Revenue' for the respective month.
Both variables consist of multiple entries and we need to sum them to obtain the total for let's say January. This works similarly to pivot tables.
Best,
Ned
Then why do we not need to use SUM from the previous lessons when calculating cogs?
Okay, I think I get it.
When calculating COGS, we made the calculation for each individual sale.
Then Tableau showed us the sum in the visualization, just like it did for other columns.
When calculating Gross Margin, if we don't use SUM, then Tableau will calculate for each individual entry and then show the sum of that. So it actually adds up all the percentages of the individual sales which is why we get huge numbers.
So, when we specifically mention SUM, then Tablue takes the sum of all the months, which is what we want for the correct calculation.
Did I make sense?