It would be great if you could share your workbook here for others to see exactly what you are getting at. The calculations not coming out as expected probably means that the are being aggregated at a level other than what you are intending. You should do a search for Level of Detail (LOD) calculations. Just remember that when you have numbers in columns A and B and want to calculate column C from them, then you are looking at adding together sums or averages or some other operations on some sort of aggregation, rather than A+B=C you are getting SUM(A)+SUM(B)=C. As far as making this dynamic goes, you may want to do a search for a tutorial called the Sandbox. In the Sandbox, multiple parameters are used in order to allow the user to pick the measures and dimensions shown on the X and Y axes as well as the type of aggregation, color, etc. This one will give you an intimate knowledge of how to work with Parameters in Tableau.
I would give you the links, but we cannot copy and paste in the browser here due to security concerns. Remember to post you sample here if possible.