Disappearing Filter when Summing

I have slight problem with the formula field: when I use the sum() function over a filter, the effect of the filter disappears.
For example:

filter(lookup('OWF in Portfolio', 'Capacity [MW]'), lookup('OWF in Portfolio', 'Status') != 'Stopped')

works fine but when I sum over it, the effect of the filter disappears:

sum(filter(lookup('OWF in Portfolio', 'Capacity [MW]'), lookup('OWF in Portfolio', 'Status') != 'Stopped'))

Has anyone an idea of what the problem could be ?

Thank you very much.

Hey @arnperr, we’re already looking into this issue, as another member reported a similar problem a few days ago: Aggregation formulas ignore filter inside (#2666) · Issues · Baserow / baserow · GitLab

While we are investigating the issue, you can use this workaround:

  • Create an additional field in the looked-up table with a formula such as: if($condition, field('a'), 0)
  • In the final table, sum this new formula field that already contains the filtered values

Apologies for the inconvenience! :raised_hands:

Hey @arnperr,

just a heads-up that a fix for this bug is in the review phase and will be part of the next release: Resolve "Aggregation formulas ignore filter inside" (!2459) · Merge requests · Baserow / baserow · GitLab

Thanks for your feedback