# Sum() + Interactive Filter

Hi guys!

Could you help me understand how I can Implement this logic, please?

I have 2 tables (Summary and Source table). In the summary table, I display the Sum() of the Price column.
I added the filter for column date in the source table.
How can I update data in the table Summary according to the interactive filter by date in the source table?
Because when I filter data in the source table, in summary, the table displays the sum of all data in the source table.
Expected result - sum in the summary table by filtered data in the source table.
Thank you!

Maybe this could work for the formula in your field `Total` (in your `Summary` table) :

``````[Source Table].Filter(
CurrentValue.Item = thisRow.Name
AND
CurrentValue.Date.matches(TheNameOfYourInteractiveFilterHere)
).Price.Sum()
``````

What this does is :

1. Like you already did : Weâ€™re looking for rows from your table `[Source Table]` where `CurrentValue.Item = thisRow.Name`
â†’ which, behind the scene returns a first list of rows

`AND`

2. From that â€śhiddenâ€ť first list of rows, weâ€™re now asking `Filter()` to only keep the rows where `CurrentValue.Date` Matches() the value in your canvas control/interactive filter.

Both conditions here needs to be `True` for `Filter()` to do its job and keep a row in the final list of rows it will return .
Once we have that final list of rows, all thatâ€™s left is to `Sum()` the corresponding prices.

Hereâ€™s a quick sample to illustrate !

Donâ€™t hesitate if you have questions or if somethingâ€™s not clear .
But in the meantime, I hope this helps

3 Likes

Dear @Pch,

Your solution seems to be working fine.

I suggest to take away the filter from the source table to avoid confusion, as less experienced â€śMakersâ€ť might not recognize the filter at first.

1 Like

@Jean_Pierre_Traets , I canâ€™t â€¦

@Andrew_Golovchenko wanted to be able to filter his `Source` table by `Date` using the interactive filter and see the result of the filter also reflected in the `Total` field in his `[Summary Table]` as said here :

Iâ€™ve added a small note at the top of my sample though , trying to clarify a little the situation here .

1 Like

Dear @Pch,

My bad, I should have read more careful the question from @Andrew_Golovchenko.

Thanks for the update

2 Likes

Thatâ€™s work for me. Thank you guys!

2 Likes

No worries @Jean_Pierre_Traets â€¦ It happens !

No problem @Andrew_Golovchenko !
Iâ€™m very glad to know it helped

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