Blending data

Hi guys;

How can i add calculated field in blending data.

Thank you.

0 1 162
1 REPLY 1

Hi,

Let’s say you’re trying to calculate Profit Margin (%), but your data is split between two different tables. One table has the Profit values from January to June 2024, and the other has the Revenue for the same time. Since the numbers are stored separately, we’ll need to bring them together before doing any calculations.

Profit:

Sichali1_0-1744364072126.png

 

Revenue:

Sichali1_1-1744364072127.png

In Looker Studio, the best way to do this is by blending the two tables. You need to blend them using a common field, in this case, Month, so that the profit and revenue values for each month line up correctly.

Sichali1_2-1744364072128.png

Once you’ve blended the data, you can create a calculated field to get the Profit Margin. The formula looks like this:

SUM(Profit (USD))/SUM(Revenue (USD))

Sichali1_3-1744364072129.png

Just a heads-up, the calculation will be done at the chart view level, not at the data source level. To add the calculation, simply insert a chart of your choice into the report and use the new blended data as its data source. Then, click on the metric section and scroll down to select Add Calculated Field. Paste the formula provided above and make sure to format the result as a percentage. You can check the link below to see what the expected output should look like.

https://lookerstudio.google.com/u/0/reporting/0ae0cafc-f889-4731-91f3-83a2111b90e2/page/2GgGF