dbt-labs / dbt-labs/metricflow

[Feature] conversion metric type: support deduplication of conversion events in 1:many scenarios

Open
#2,068 1 comment 0 reactions 0 assignees View on GitHub
enhancement triage
Dominant language
Python
Stars
1.8k
Forks
202
Avg merge
1d 8h
Merged PRs (30d)
14

Description

### Is this your first time submitting a feature request?

- [x] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [x] I have searched the existing issues, and I could not find an existing issue for this feature
- [x] I am requesting a straightforward extension of existing metricflow functionality, rather than a Big Idea better suited to a discussion

### Describe the feature

## Problem

When multiple conversion events are tied to a single base event within the conversion window, MetricFlow calculates `count(conversion_events) / count(base_events)`, which produces conversion rates >100%.

**Example:**
- Base event: a property rental listing is created
- Conversion event: a review is posted on that listing
- If 2 reviews are posted for 1 listing within the conversion window, the conversion rate shows as 200% (2/1) instead of 100% (1/1)

## Expected behavior

Users expect `count(base_events_that_converted) / count(base_events)` — i.e., each base event should count as converted at most once, regardless of how many conversion events are linked to it.

## Current workaround

Pre-compute deduplication in a dbt model (e.g., flag each base entity as converted/not converted), then define a simple ratio metric on that flag. This works but bypasses the `conversion` metric type entirely.

A combination of `conversion` calculation type + a ratio metric was also investigated and does not resolve the issue.

## Request

Add a native option to the `conversion` metric type to cap conversion events at 1 per base entity — effectively computing `count(distinct base_events_that_converted) / count(base_events)`.

## Context

Raised via customer support. Confirmed as a gap by @paul-yang. Related (but not identical) to #2049.

### Describe alternatives you've considered

_No response_

### Who will this benefit?

_No response_

### Are you interested in contributing this feature?

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.