# Plot graph with group by table column

**URL:** <https://community.grafana.com/t/plot-graph-with-group-by-table-column/48213>\
**Category:** Grafana\
**Created:** [May 28, 2021, 8:13pm UTC](https://community.grafana.com/t/plot-graph-with-group-by-table-column/48213 "2021-05-28T20:13:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jollyrogers](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jollyrogers](https://community.grafana.com/u/jollyrogers)\
**Post date:** [May 28, 2021, 8:13pm UTC](https://community.grafana.com/t/plot-graph-with-group-by-table-column/48213/1 "2021-05-28T20:13:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![svetb](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/svetb/32/3307_2.png) [@svetb](https://community.grafana.com/u/svetb)\
**Post date:** [May 28, 2021, 9:24pm UTC](https://community.grafana.com/t/plot-graph-with-group-by-table-column/48213/2 "2021-05-28T21:24:26Z")

</div>

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](https://community.grafana.com/t/example-of-labels-to-fields-transform-with-influx-data/48192))…so would also love to know the answer to this.

---

<div class="post-metadata">

**Author:** ![kiranhappy](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/kiranhappy/32/21215_2.png) [@kiranhappy](https://community.grafana.com/u/kiranhappy)\
**Post date:** [February 2, 2022, 7:50am UTC](https://community.grafana.com/t/plot-graph-with-group-by-table-column/48213/3 "2022-02-02T07:50:24Z")

</div>

Any possibility to do this? I am not able to do this in Grafana.

The closest information I have found is this Timeseries dimension [link](https://grafana.com/docs/grafana/latest/basics/timeseries-dimensions/). But don’t know how to utilise the information in that document. For e.g where to provide the label or to auto generate the label.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [May 28, 2022, 8:14pm UTC](https://community.grafana.com/t/plot-graph-with-group-by-table-column/48213/4 "2022-05-28T20:14:05Z")

</div>

This topic was automatically closed after 365 days. New replies are no longer allowed.
