Everything you've shown here is a regular calculation, so you didn't tell us where the table calc was and why you needed one. Please attach a workbook if you need more help.
You can't build a level of detail expression on a table calculation. You can usually do whatever you wanted directly in a table calculation, though.
You can do Portfolio thing in LOD..Provide some data and requirement pl