No matter the source of the data, first plan out the relationships using the following as a base (which of course does not match your exact requirements)
You can then load data from models. When using a DataSet, setup relationships while with Entity Framework via database first models are created with the proper relations.
From there query the data and format to suit your requirements.
Use Average to get averages.
This all may seem vague, it is but is a solid path to complete your task. If and when you get stuck come back and explain in detail (be very specific e.g. it doesn't work will not due) the problem and what you tried.
We are not mind readers so be specific with questions and details.