In this blog I'm going to try and explain what I understand so far about LODs and table calcs in tableau. I am assuming some prior knowledge on how LODs work but if you are unsure there are plenty of great blogs explaining them.
Table Calcs and LODs
There are a variety of table calculations from the calculated field and from when a measure is brought in to the view, you can right click and add a table calculation. Table calcs can be computed in different ways.
So this is probably not super intuitive but to get a running total for each category you have to UNCHECK this box.
This can also be calculated using an LOD. The field that is UNCHECKED in the compute using of a table calc is usually used in the LOD, from what I've seen so far anyway.
Here I have fixed the calculation to [Category] and instead of calculating a running total, as with the table calculation, I just have a sum of the sales, which gives me the total for the sale for each category. This can be quite useful for BANs. A table calculation can be performed on this but a running total here, depending on how it is computed, would just add together all of these values.
Here the table calculation is calculated by month so 742K + 719K + 836K to give ~ 2M, which are the total sales overall for all the categories. So table calcs can be used on top of LODs, if you like.
It can be quite helpful to first sort out your table calcs and LODs in a table before turning them in to a graph so you can see if you are getting the values you want more easily.
When to use each
From what I've learned so far table calcs are dependent on the viz level of detail (so whatever fields are in the view) whereas LODs can be used on fields that are not in the view. If the fields in the view change then the table calc will also change but an LOD will not.
If you want to calculate the average sales for each unique order within each category.
An include LOD can help to declutter your view and make it easier to see the average value as you don't need order ID on the view to calculate the average.
Using an LOD in this circumstance would be more preferable a with a table calc order ID would need to be in the view which can make the viz too busy as the bars cannot be aggregated in the same way.
Note: The way this average is calculated is SUM(sales)/CNTD(order ID) using average sales instead of sum sales would give a different value as CNT(order ID) would be used instead.
The order of operations in tableau can also influence whether or not a table calc or LOD should be used.
Table calcs come after context, dimension and measure filters meaning that each of these filters will effect the value produced by the table calc.
If I filter out Furniture from category the values will change.
However, if I use a LOD the values will remain the same regardless of the filter.
This can be useful if you want to see how much each category contributes to the overall sales for the region.
Only when the filter is added to context, do the sales values change for the LOD calculation.
From what I know besides these cases, table calcs and LODs can be used pretty interchangeably and give similar values with varying flexibility as I mentioned. One particular good use case for table calcs and LODs are for year on year calculations. Although table calcs are more prone to change, in some cases table calcs can be easier to calculate than LODs, especially when you have the fields you want in the view already.
Here a table calc was used to colour the bars that are above the average sales for each category. So the category box in the table calc was UNCHECKED.
SUM([Sales])>WINDOW_AVG(SUM([Sales]))
Using an LOD to do the same thing would be slightly more complicated.
SUM([Sales])>sum({ FIXED [Category]: AVG(
{ FIXED [Category],[Sub-Category]: SUM([Sales])})})
So it is really up to you and your visualisation.
Like I said I haven't got a proper understanding yet on how to use these but I wrote this to try and consolidate what I have learned so far. I hope it was a useful read.