you can set condition in "Dimension limit" tab of chart property according to your variable (which should update after moving slider).
So if you select 5(percent) in slider, so variable value should 5 then change condition in Dimension Limit tab according to your need like "Show only" and then set slider variable there.
In expression, add your normal expression. no need put condition according to slider variable.
I hope this helps you.