# Calculated Metric for a specific event in GA4 data-source

**URL:** <https://discuss.google.dev/t/calculated-metric-for-a-specific-event-in-ga4-data-source/296309>\
**Category:** Data Studio Q&A\
**Tags:** exploring-data\
**Created:** [December 11, 2025, 2:33pm UTC](https://discuss.google.dev/t/calculated-metric-for-a-specific-event-in-ga4-data-source/296309 "2025-12-11T14:33:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent-N](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/laurent-n/32/120534_2.png) [@Laurent-N](https://discuss.google.dev/u/Laurent-N)\
**Post date:** [December 11, 2025, 2:33pm UTC](https://discuss.google.dev/t/calculated-metric-for-a-specific-event-in-ga4-data-source/296309/1 "2025-12-11T14:33:42Z")

</div>

Hi guys.

I’ve been struggling with a setting I never thought would be so tricky ;

I’d like to create a simple Calculated Field (Metric) in the GA4 data-source, that could return the Event Count for a specific event.

I need this Calculated metric to be available in the data source, so I can handle it as any metric in the charts.

I have tried formulas such as (with SUM aggregation) :

```sql
CASE
  WHEN Event name = "appointment" THEN 1
  ELSE 0
END

```

or

```sql
CASE
  WHEN Event name = "appointment" THEN Event count
  ELSE 0
END

```

but it always return 1

If someone has a tip ! thanks a lot !

best regards

Laurent

---

<div class="post-metadata">

**Author:** ![sam8](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/sam8/32/21646_2.png) [@sam8](https://discuss.google.dev/u/sam8)\
**Post date:** [January 15, 2026, 7:00pm UTC](https://discuss.google.dev/t/calculated-metric-for-a-specific-event-in-ga4-data-source/296309/2 "2026-01-15T19:00:27Z")

</div>

Your first formula looks good to me!

It will return different numbers with different levels of aggregation. If you don’t select any dimensions, and only select this calculated metric, does it display the number that you expect?
