As mentioned in my earlier post - the generation of the query is really limited by the tool you're using to access the cube. All things being equal, you could probably achieve this with reporting services with minimal effort. If you're putting something Excel in front of your users then you're limited to the functionality it exposes (so it will allow you to filter in, or filter out, but it would appear, not both at the one time).
Steve.