# How to apply a custom event category filter within a calculated metric?

**URL:** https://community.piwik.pro/t/how-to-apply-a-custom-event-category-filter-within-a-calculated-metric/2848
**Category:** Reports and working with data
**Created:** [September 6, 2023, 3:26pm UTC](https://community.piwik.pro/t/how-to-apply-a-custom-event-category-filter-within-a-calculated-metric/2848 "2023-09-06T15:26:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tom](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Tom](https://community.piwik.pro/u/Tom)
#### Post date: [September 6, 2023, 3:26pm UTC](https://community.piwik.pro/t/how-to-apply-a-custom-event-category-filter-within-a-calculated-metric/2848/1 "2023-09-06T15:26:12Z")

</div>

Hi all,

I’m currently trying to create a calculated metric that takes the count of “Custom event name” and then applies a filter where Custom Event Category = “formSubmit”.

This would ideally only show the count where the custom event category is equal “formSubmit”.

Is this possible to do within a calculated metric?

If not, is there a workaround/alternative?

Many thanks,

Tom

---

<div class="post-metadata">

### Author: ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)
#### Post date: [September 7, 2023, 9:34am UTC](https://community.piwik.pro/t/how-to-apply-a-custom-event-category-filter-within-a-calculated-metric/2848/2 "2023-09-07T09:34:59Z")

</div>

Hi @Tom,

It’s not possible to do within calculated metric. Calculated metrics do not have option to filter data. Only calculate it.

You have couple option here:  
The one I would recommend would be to [create a Goal](https://help.piwik.pro/support/reports/goals/) “Form Submit” looking something like this:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/d/d5995e8deddd1ab62b93f4e828cea86e120e5de4.png)

Once you have that goal then you can use it in reports as I believe you’d want:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/2/2e4d318da8c3f307d331118903c01bc7b83dbca7.png)

Important note here is that this solution will not work backwards, only data after creating this goal.

---

<div class="post-metadata">

### Author: ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)
#### Post date: [September 7, 2023, 9:37am UTC](https://community.piwik.pro/t/how-to-apply-a-custom-event-category-filter-within-a-calculated-metric/2848/3 "2023-09-07T09:37:12Z")

</div>

Other option would be to use filters in reports directly, but they will be applied to all the data in report, not only one specific metric, that’s why I would recommend first method
