# How can I add a filter on just one column / measure? (filtered measure)

**URL:** <https://community.omni.co/t/how-can-i-add-a-filter-on-just-one-column-measure-filtered-measure/31>\
**Category:** Workbooks\
**Tags:** filtered-measure, ui-based-modeling\
**Created:** [April 5, 2024, 10:05pm UTC](https://community.omni.co/t/how-can-i-add-a-filter-on-just-one-column-measure-filtered-measure/31 "2024-04-05T22:05:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anika](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.omni.co/anika/32/12_2.png) [@anika](https://community.omni.co/u/anika)\
**Post date:** [April 5, 2024, 10:05pm UTC](https://community.omni.co/t/how-can-i-add-a-filter-on-just-one-column-measure-filtered-measure/31/1 "2024-04-05T22:05:04Z")

</div>

To apply a filter to one but not all measures in a given query, you can use a filtered measure.

There are two easy ways to create a filtered measure from the UI:

1. Create a query with the measure you’d like to filter, and then pivot on the dimension containing the value you want to filter, then use the quick “Create Filtered measure” menu item  
 ![create_filtered_measure_quick_agg](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/d247ec6183ad90add21c0e0ccac814f31e166aa0.gif)

2. Create a new measure and add a filter to it by Editing the Field. You can create a new measure either from a the quick Aggregation menu on a dimension (shown in the gif below), or by duplicating an existing measure from the menu in the field picker.  
 ![filtered_measure_duplicate](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/5ce8ffa909f22a36c655c2bb8b53d8683abf2476.gif)

If you would prefer to do this from the IDE, you can also create a filtered measure in code. For example:

```yaml
  order_items_count_status_complete:
    aggregate_type: count
    filters:
      status:
        is: Complete

  margin_sum:
    sql: ${order_items.margin}
    label: Completed Order Margin Sum
    aggregate_type: sum
    filters:
      status:
        is: Complete

```

For more, check out the [filtered measure documentation](https://docs.exploreomni.com/modeling/measures#filters).

If you’re more of a SQL Person, you’ll notice that filtered measures are essentially equivalent to writing something like `COUNT(DISTINCT CASE WHEN status = 'Complete' THEN order_id ELSE NULL END`, but has the added benefit of intelligently passing through the filter value when you drill.
