Plot graph with group by table column

Running grafana v7.5.3. After some 1950-s technology influxdb queries I have used “Transforms” to produce a table with columns “Time,Metric,Value” with “Time,Metric” being unique, so there being multiple time series for Value for different Metrics. How can I plot this grouped by “Metric”?

Eg:

2021-01-01,Yellow,1
2021-01-01,Red,7
2021-01-02,Yellow,2
2021-01-02,Red,4

I’d like to see two lines on the graph, one for “Yellow” and one for “Red”. I’m not seeing any “group by” options anywhere. The “group by” transform as a last transform does not produce that either.

Having used databricks and redash where I can simply select the “group” column – where is this in grafana?

I think in theory - at least based on the docs - the “labels to fields” transform should do what you need. That said, I haven’t been able to get it working myself (posted about it earlier)…so would also love to know the answer to this.