How to add calculated column to OSI PI Datasource before adding data to rows of table

I have a data source that I got from OSI PI and add to an existing data table if it exists:

	ds = DataSourceImpl(pm)

		if Document.Data.Tables.Contains(dt_name):
			column_settings = AddRowsSettings(Document.Data.Tables[dt_name], ds)
			Document.Data.Tables[dt_name].AddRows(ds, column_settings)
			Document.Data.Tables.Add(dt_name, ds)

However, I would like to calculate a new column based on values from the data source. I want the combined data source data and new calculated column added as rows to an existing datatable. How would I add this?

(1) Answer