A variable is a constraint placed on the query when the query is processed.
To use all selected members as a variable (the user is prompted for the values when the query is processed:
In the data layout, select a dimension member and select Edit on the shortcut menu.
Select Use as variable.
Click OK.