I've been able to do this by creating new column result2 which is NULL unless type=the variable I want, but it's a bit time intensive and messy
I would use two parameters in this case. A parameter to create the bins, and also a parameter that filters the data.
if Param = 1 then [Calc 1]
elseif Param=2 then [Calc 2]
It'd be difficult to come up with one in my head without playing with the data, but I'd probably start with something like the above.
Hope this helps,