By default, a filter applied in one table does not affect a rollup in another table. A rollup field will roll up data from all records in the target linked table, regardless of whether or not those records have been filtered in some way.
If you wish to use a rollup field, but have it only aggregate values from certain linked records in each cell, you will need to use formulas. For more on how to do this, please see the article on conditional rollups.