Calculate series from POSTGRES

I have a table in POSTGRES with the following structure

id,timestamp,engineeringvalue
178,1527506108366,100.9
185,1527506108366,1475.23
178,1527506167365,98.86
185,1527506168465,1485.55
178,1527506227564,98.25
185,1527506227564,1490.06
178,1527506287663,98.8

in addition to feature 185 and 179 there is 32 other features in the datatable. Currently approximately 9 mill. rows and new inflow of rows approximately 1 mill. rows per month.

I am using Grafana to visualise features 185 and 178 by during the following Select

Series A
SELECT __time(timestamp/1000,10m,previous), avg(engineeringvalue) AS "Feature A" FROM analogsignalfud WHERE id=178 and timestamp &gt;= __unixEpochFrom()::bigint1000 and timestamp <= $__unixEpochTo()::bigint1000 GROUP BY 1 ORDER BY 1

Series B
SELECT __time(timestamp/1000,10m,previous), avg(engineeringvalue) AS "Available Power" FROM analogsignalfud WHERE id=185 and timestamp &gt;= __unixEpochFrom()::bigint1000 and timestamp <= $__unixEpochTo()::bigint1000 GROUP BY 1 ORDER BY 1

This is working very well to graph the features. The features are derived from an event based log and therefore the “timestamp” are not synchronised between that features. Still Grafana “fix” this in the Graph where the data is visualised.

I want to use the A and B Series in a new Series C that is a calculated features where A and B are used. Is this possible when Postgres is the source and the timestamp for the Features are not synchronised.