Search code examples
metricslooker-studio

How to calculate the ratio between the grand total of two metrics on Google Data Studio?


I created a table on Data Studio that shows the columns:

A: Date B: 1st metric (number) C: 2nd metric (number) D: custom formula to calculate the ratio between the 1st and 2nd metric (percentage)

Then I checked the option to show the Summary Row that sums all the values of each date. But in the column D I don't want it to calculate the sum of the values in column D (nor the average of the values), instead, I want the ratio between the sum of the values of column D and C. How to achieve that?

enter image description here


Solution

  • To have the calculated field correctly in the total, you have to make sure to aggregate your calculated field. To do so, use 'sum()' in your calculation. That would be this formula:

    sum(total sales)/sum(gross sales)
    

    I hope this answers your question!