Please post a sample .twbx file.
It sounds like you've applied a filter and so you may have an order of operations issue. Tableau is filtering first then calculating the table calculation afterwards. You will probably need to replace your table calculation with an LOD calculation. Without the workbook (as Tushar notes) we are unable to give you the exact solution but this may put you on the right path.
For reference, the tableau order of operations