Build datatable after if condition

I have a datatable to sum value (column amount ) to a certain value, eg. Zero amount. Once condition met, I wan to build another new datatable for those row item total up to the Zero amount in the original datatable. anyone can. Thanks in advance.