(IF [Product]="Mac" THEN SUM([revenue]) END) / (IF [Product]="PC" THEN SUM([revenue]) END)
Shawn is right, however, you might have difficulty in getting the measure to populate.
Therefore, separate the two clauses into 2 separate calculated fields:
(IF [Product]="Mac" THEN ([revenue]) END)
(IF [Product]="PC" THEN ([revenue]) END)
Then, create a third calculation to find the ratio:
sum([Mac Revenue])/sum([PC Revenue])
Hope this helps!
Thanks Tracy, Shawn! I can't seem to make the final calculation work though - the ratios all end up as null! It appears that, for each product/month calculation, Tableau either calculates a PC revenue or a Mac revenue, and sets one of the two to null - which is fine when summing the revenues of one of the products, but makes it difficult to calculate a ratio using these calculated fields.