Calculated Metric for a specific event in GA4 data-source

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) :

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

or

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

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?