Short answer: we need a parameter table.
This because we might be able to write a measure that internally sets the filter according to our specification, but the Power BI visual would intercept the slicer setting first and would show only the selected rows or columns (for a matrix visual).
Assuming we have the table

this measure ignores any selection from the slicer, computing the total of the whole column, but the matrix visual will only show the row selected with the slicer
TotalV = SUMX(ALL(T), T[V] )

To solve this we can build a parameter table with the combination we want when selecting the F parameter, for instance like the following Parameter
table

The column P
is to be used in the slicer, while the column F
is used to set up a bi-directional relationship with the original T
table
Now we create the relationship

We create the measure
SumV = SUM(T[V])
setting the slicer over 'P' and a matrix with 'T[F]' on the rows and the measure '[SumV]' as value we obtain the desired behavior

Additional considerations:
- the Parameter table can be generated manually or using a DAX
calculated table
- to build a better model we might create a dimension for F
- the bidirectional relationship in this configuration doesn't make
the model ambiguous, but we must pay attention when adding tables
and relationships to the model