[Feature] Allow metrics/measures to be referenced in filters and where
clause
#740
Closed
3 tasks done
Labels
where
clause
#740
Is this your first time submitting a feature request?
Describe the feature
Currently, filters and the where clause can only reference dimensions. This is overly restrictive, and there are valid cases where I might want to filter by a metric value. For example, I might want to calculate total revenue but only include users who made less than 3 orders in the last 10 days. The SQL to calculate this metric is simple:
However, this is challenging to do in MetricFlow and requires you to precompute the
order_count_l10d
on your dbt model, before referencing it as a dimension.Describe alternatives you've considered
The only available workaround is to duplicate the aggregation logic in your dbt model and make a separate semantic model as a dimension source. Very much not ideal.
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: