Filtered average returns same value down the column

Hi all! I have a reference table (REFERENCE) in which I keep all of the values (THEME) for a tagging system in my main database (MAIN). I would like to return averages into my reference table of the performance data of all entries in MAIN that have the corresponding tag.

The tables are related, as MAIN pulls in the tag values from REFERENCE for the drop-down multi-select.

Average([MAIN].[STATISTIC].Filter([MAIN].[THEME].Contains(thisRow.THEME).Filter([MAIN].[STATISTIC]>0)))

This returning the average of the entire column, unfiltered, in every cell instead. Can anyone help?

1 Like

The problem is that you are filtering the STATISTIC column instead of the whole MAIN database. Also you can combine the two filters into one. Try this instead:

[MAIN].filter(
  [MAIN].[THEME].Contains(thisRow.[THEME])
  AND [MAIN].[STATISTIC]>0
).[STATISTIC].Average()

Hope this helps,

Pablo

2 Likes

Thanks. It’s still not returning any values for fields in which the rows in [main] have more than one [theme] are selected. Those are just blank. And for those it is returning, it’s the average of the unfiltered column. Any ideas?

1 Like

I would need to take a look at how have you set it up. Would you mind sharing a dummy doc?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.