# Group data by row value

**URL:** <https://community.grafana.com/t/group-data-by-row-value/164665>\
**Category:** Grafana\
**Tags:** transformations\
**Created:** [October 9, 2026, 1:49pm UTC](https://community.grafana.com/t/group-data-by-row-value/164665 "2026-10-09T13:49:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnaubria](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/arnaubria/32/52885_2.png) [@arnaubria](https://community.grafana.com/u/arnaubria)\
**Post date:** [October 9, 2026, 1:49pm UTC](https://community.grafana.com/t/group-data-by-row-value/164665/1 "2026-10-09T13:49:52Z")

</div>

Dear all,

I’m trying to get a gauge (i think this is what I want) panel that should show 2 values: members of an AD group - members in that AD group that have logged to a system.  
I get all the information from 2 queries that I join based on a common field. At the end I end up with a table like:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/e/4/e47d8227351645f432a91e73e7cc27107097d2fb.png)

one of the values should be 103, the one coming from “username (count) → 1” , and the other value should be either the sum of all (a value that represent the totality of users) or the sum of the "username (count) " with a value different to 1 (18+55+74+16+5+2+3).

I’ve been playing with transformation but I cannot achieve what I want so, at this point I’m wondering if this is something doable in grafana or that infor should be provided from my script → datasource.

any advice is apreicated,

Best,

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [October 9, 2026, 3:55pm UTC](https://community.grafana.com/t/group-data-by-row-value/164665/2 "2026-10-09T15:55:00Z")

</div>

What is your datasource/query? Why you can’t write query with required grouping directly?

---

<div class="post-metadata">

**Author:** ![infofcc3](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/infofcc3/32/51248_2.png) [@infofcc3](https://community.grafana.com/u/infofcc3)\
**Post date:** [October 10, 2026, 4:40am UTC](https://community.grafana.com/t/group-data-by-row-value/164665/3 "2026-10-10T04:40:41Z")

</div>

Hi @arnaubria,

Yes, this can be done in Grafana using two Gauge panels with the same queries.

**Panel 1: Value 1 (103)**

Transformation: Filter data by values → Include → `username (count)` → Is equal → `1`.  
Value options: Calculation = Total; Fields = `username (count) (count)`.

**Panel 2: Other values (173)**

Transformation: Filter data by values → Exclude → `username (count)` → Is equal → `1`.  
Use the same Value options as Panel 1.

Set Standard options → Max to `276` if you want each gauge to show its proportion of the combined total.

If you prefer a single panel, return the two aggregated values from your query or script as separate rows and use Show: All values.

---

<div class="post-metadata">

**Author:** ![arnaubria](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/arnaubria/32/52885_2.png) [@arnaubria](https://community.grafana.com/u/arnaubria)\
**Post date:** [October 10, 2026, 3:10pm UTC](https://community.grafana.com/t/group-data-by-row-value/164665/4 "2026-10-10T15:10:12Z")

</div>

> [@infofcc3](#):
>
> e two aggregated values from

thanks a lot for the answer. I ended up playing with the qeury to endup with a table like this:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/0/d/0d3e73bc017f082728e9a6e6d5b306ac2ff4bd2f.png)

I’d like to have all in a single gauge where potential users i the max and real users a subset of it.  
I kind of can do it defining the max in standard options:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/6/b/6bb681ddca576e5a4f85e61b70b6ad1939180e15.png)

but is there a way to combine the two values in single gauge using one value as max?

again, thanks for the answer.

Best,
