The short answer is - you can't
The values must be in the view so you can reference them. The trick is to figure out how to have the values present in the view (so you can use them in the calculation), but not visible to the user. This is usually through a mix of measure filters, maybe using LAST() or hiding the values (ie. not excluding, but hiding).
Mock up a sample and attach it and I can show you if required.