How to apply filters to some fields in Lens

If I have a Legacy Metric with this formula:

sum(data.bills)/(sum(data.sales)

And I want to add a filter like this:

{ "match_phrase": { "data.style": "Lease" } }

But the documents that have the field data.sales never have the field data.style, so, when I apply the filter, shows no result.

Is there any way to "tell" Lens to apply that filter to the numerator (sum(data.bills)) and not to the denominator?

I wonder if you can add a runtime field for "data.style" in to documents and solve this problem?

Thanks,
Bhavya

At the end I did it with KQL filter in the actual formula.. something like this:

sum(data.bills,kql='data.style: "Lease"')/(sum(data.sales)```
And works perfectly.