2 Replies Latest reply on Feb 1, 2012 6:17 AM by Gregg Thomas

# How to calculate %'s in financial statements using different denominators

Is it possible for tableau to calculate %'s using different accounts as the denominator.  I've set up a financial statement, with the accounts and corresponding amounts.  Now i need to show what % that amount is of sales...

For example, Food cost expense should be divided by total food sales.  But in this same view, I need to show labor %, which is labor expense divided by total sales.  I've tried numerous if/then, case & lookup formulas and can't see to get it to work.

Thanks!!

• ###### 1. Re: How to calculate %'s in financial statements using different denominators

Yes, this can be done, with an IF/THEN of the following type (using the Coffee Chain sample db):

IF ATTR([Product Type]) = "Coffee" THEN

SUM([Sales])/TOTAL(SUM(IF [Product Type] = "Coffee" THEN [Sales] ELSE 0 END))

ELSE

SUM([Sales])/TOTAL(SUM([Sales]))

END

The Compute along for this table calculation will need to be set to Table Across then Down. You can see this in the attached workbook.

• ###### 2. Re: How to calculate %'s in financial statements using different denominators

Thank you so much!  I was able to use this base calc and expand on it to get the correct %'s for every line.