Tutorial: Create a ratio field based on filtered metrics

Use data blending to calculate and compare values for fields that meet certain conditions.

A common use case in reporting and data visualization is to display key performance indicators (KPI) as ratios of one indicator as compared to another. For example, suppose you are measuring the completion rate of an online coding academy. A KPI for the course is completion rate, which we'll define here as:

Course completions / Course registrations

If your data set already contains this data then you can simply display the result in Data Studio. But what if you need to calculate it in your report, or need to display completion rates based on filtered data? The solution is to use data blending.

Say your data looks like this:

Event Category Event Action Course Number Unique Events
Course Certificate Download 9 299
Course Complete Fail 8

21

Course Complete Fail 9

86

Course Complete Pass 9

337

Course Complete Fail 6

34

Course Complete Pass 7

363

Course Complete Fail 7

17

Registration Register 8

814

Registration Register 7

475

Registration

Register 5

574

Registration Register 9

1078

Registration Unregister 6 22

Step 1. Calculate the course completions

  1. Add a scorecard to your report. Call it Course Completions.
  2. Set the metric to Unique Events.
  3. Add a filter to the scorecard to ignore non-completion events:
    1. Include Event Category = "Course Complete"
    2. AND
    3. Include Event Action = "Pass"

Based on the sample data, the scorecard would look like this:

Course Completions

700

Step 2. Calculate the course registrations

  1. Add a scorecard to your report. Call it Course Registrations.
  2. Set the metric to Unique Events.
  3. Add a filter to the scorecard to ignore non-registration events:
    1. Include Event Category = "Registration"
    2. AND
    3. Include Event Action = "Register"

Based on the sample data, the scorecard would look like this:

Course Registrations

2,941

Step 3. Blend the data from the scorecards

  1. Select the Course Registrations scorecard, then select the Course Completions scorecard.
  2. Right-click, then select Blend data.

This creates a new scorecard that automatically calculates the ratio between those metrics:

Course Completion Rate

23.80%

 

To create more complex calculated fields or change the number display:
  1. Select the blended scorecard.
  2. Edit the metric.
  3. Enter a new formula and/or change the field Type to match the data.

Example of editing a scorecard.

Learn more about how blending works:

Was this helpful?
How can we improve it?