Normally I would create the measure/calculation in the loadscript. Then it becomes a dimension you can filter on.
If your calculation is a dimension, then you can use ranges in the filter on tables. If you want to have a filterpane instead, then I would create that in the loadscript as well. You can do that by using if() statements.