Dynamic Total Row

Hi Dears,

i know the ways to create a Total Row, but i am asking how can i make it response Automatically with a selections of a Table view?