Swap rows and columns in DataTable

I have an requirement where in i have to swap nested columns spanned header to row axis and vice-versa in datatable. Is it possible to do that.

It will be good if anybody can share the code snippet for the same.

Thanks