[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[],[],null,["# Tutorial: Create a ratio field based on filtered metrics\n\nA 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:\n\n`Course completions / Course registrations`\n\nIf your dataset already contains this data then you can display the result in Looker 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.\n\nSay your data looks like this:\n\nStep 1: Calculate the course completions\n----------------------------------------\n\n1. Add a scorecard to your report. Call it **Course Completions**.\n2. Set the metric to *Unique Events*.\n3. Add a filter to the scorecard to ignore non-completion events:\n\n `Include`**`Event Category`** `= \"Course Complete\"`\n\n `AND`\n\n `Include`**`Event Action`** `= \"Pass\"`\n\nBased on the sample data, the scorecard would look like this:\n\nStep 2: Calculate the course registrations\n------------------------------------------\n\n1. Add a scorecard to your report. Call it **Course Registrations**.\n2. Set the metric to *Unique Events*.\n3. Add a filter to the scorecard to ignore non-registration events:\n\n `Include`**`Event Category`** `= \"Registration\"`\n\n `AND`\n\n `Include`**`Event Action`** `= \"Register\"`\n\nBased on the sample data, the scorecard would look like this:\n\nStep 3: Blend the data from the scorecards\n------------------------------------------\n\n1. Select the *Course Registrations* scorecard, then select the *Course Completions* scorecard.\n2. Right-click, then select **Blend data**.\n\nThis creates a new scorecard that automatically calculates the ratio between those metrics:\n\n| **Tip:**\n|\n| To create more complex calculated fields or change the number display:\n|\n| 1. Select the blended scorecard.\n| 2. Edit the metric.\n| 3. Enter a new formula and/or change the field **Type** to match the data.\n|\nRelated resources\n-----------------\n\nLearn more about how blending works:\n\n- [About data blending](/looker/docs/studio/how-blends-work-in-looker-studio)\n- [Use blending to re-aggregate data](/looker/docs/studio/use-blending-to-reaggregate-data)"]]