As explained in our training video on parameters, we can control how filters get applied by writing custom shelf expressions.
In this example, we want to show how we can avoid filtering the entire visual but instead customize which measures get filtered during the aggregation.
Here’s our sample data, Date Year is going to be the dimension we want to use for filtering:
To aggregate specific measures based on filter values, we will use custom parameter expression like the following:
sum(if([Date Year] in (<<Date Year.data:''>>), [Sales], 0))
Notice that we have enabled “explicit scope” parameter setting panel on the right. And we created two shelf elements with the custom sum-if expression. For the Sales & Revenue.
Now in our dashboard when we make selections in the Date Year filter, that will set parameter “Date Year”, which then gets used in our custom expression for sales & revenue.
Notice how Profit aggregate never changes and always shows the same value even after making other Year selections: