metabase / metabase/metabase

Suppression of small sample sizes in filters and results (minimum group-size threshold / deidentification)

Open
#77,144 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.Auto triaged .Team/UXWest Reporting/Dashboards Reporting/Dashboards/Filters & Parameters Type:New Feature
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

**What problem will this feature request solve?**
In people/HR analytics — and equally in social science, behavioral science, public-health, education, census, and other sensitive population research and analysis — exposing data for very small groups can re-identify individuals. This is the classic **small-cell / small-sample suppression** requirement from statistical disclosure control and **deidentification** (a.k.a. de-identification, k-anonymity / minimum-cell-size rules): values backed by fewer than *N* records must be **suppressed** so individuals can't be inferred.

Today there is no built-in way to enforce a minimum-group-size suppression threshold in Metabase. Two gaps in particular:

- **Filters:** linked filters cascade correctly (parent → child), but there is no way to require a minimum underlying row count for a value to appear in a dropdown. Small groups (e.g. fewer than 5 users) still show up as selectable options.
- **Results:** the same small groups still appear in chart results — e.g. every demographic value becomes its own line in a time-series, including a group of 3 users.

Workaround attempted: pointing the child filter at a saved question with a `HAVING COUNT(...) > 4` clause ("From another model or question" as dropdown source) *does* apply the count threshold, but doing so **bypasses linked filters** — the child dropdown no longer respects the parent selection (e.g. the demographic-value list stops narrowing to the chosen demographic-type). So today a user can get *either* suppression *or* cascading linked filters, but not both.

**Describe the solution you'd like.**
A first-class way to apply a minimum-count **suppression threshold** to a linked filter and the charts it drives, so values whose underlying row count is below the threshold are suppressed from:
- the filter dropdown options, AND
- the chart results (e.g. a per-group line is omitted entirely from a time-series when that group is below the threshold).

The threshold is a count of underlying rows/users (not a count of distinct options). One suggested shape: allow a saved question with a `HAVING`-style aggregate condition to serve as a linked-filter dropdown source **while still respecting parent linked-filter selections**. For below-threshold groups in results, the preferred display is to omit them entirely (or show a "Below privacy threshold" placeholder) rather than showing `0` or the real count — showing `0` falsely implies "no activity."

**How does this feature request impact you?**
High — without this, teams cannot safely build the analytics dashboards they need; suppressing sub-threshold groups is a hard privacy/compliance requirement across HR/people analytics, social and behavioral science, public health, and other sensitive population research, not a preference.

**Additional information**
n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing how linked-filter options are queried and how grouped chart results are produced, then identify where parent selections and aggregate thresholds could be preserved together. Done means below-threshold groups are absent or clearly suppressed in both dropdowns and chart results without breaking cascading filters.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
analytics, data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.