For your average calculation, the filtered out data is automatically excluded from the calculations, and you do not have to do anything special here.
1. In the below image, I have selected all the states, and showing you the average profit and sum of profit here.
2. Now, I am deselecting some of the states, and you can see that both the average profit and sum of profit values change.
Averages.twbx 1.2 MB
Thanks for answer. Actually all my fields are separate calculated fields.
Anyways I have changed my way of calculation and brought it in single calculated field and I used your solution to get my result.