You might get some value from going through some of the tutorials and documentation.
The transaction event type has many attributes. One of them is duration. NRQL has many functions, but some of them that may help you are average(), min(), max(), percentile() etc.
So something like this works:
Select average(duration) from Transaction where appName = 'foo' facet name since 1 day ago timeseries auto limit max
This is basic new relic stuff. I mean this is the bread and butter stuff, but knowing this is key to using New Relic so I’m guessing you are brand new to it. Read read read the documentation. Like so many complex software solutions there is a lot of detail and using it can be an ‘art’.
The above query says you want the duration plotted on a 1 day chart and you want to see a line for each named transaction on your APM application and you want the intervals for the points on the chart to be decided by the system. You are also telling it not to stop with a handful of names and to list as many as your account settings would support. That might be 2000. So if you have 20 transaction names you will show all 20.