Microsoft Fabric Updates Blog

Introducing Aggregations in Fabric API for GraphQL: Query Smarter, Not Harder

Summarize, group, and explore data in one step with the new GraphQL aggregations feature

We’re excited to launch a powerful new capability in the Fabric API for GraphQL—Aggregations. This feature brings native support for summary-level insights directly into your GraphQL queries, making your data exploration faster, simpler, and more efficient.

Why Aggregations?

Until now, getting summary metrics like totals, averages, or counts required workarounds—either writing custom logic or running multiple queries and doing the math client-side. Aggregations change that.

Now you can:

  • Query KPIs and summary values directly from your API.
  • Use filtering, slicing, and grouping with the new group by argument.
  • Build dashboards and apps that load faster with fewer queries.

The new aggregation operations include:

  • count – Count of records (or non-null values of a field) in the group.
  • sum – Sum of all values in a numeric field.
  • avg – Average (mean) of values in a numeric field.
  • min – Minimum value in a field.
  • max – Maximum value in a field.

How It Works

With Aggregations, you can use the new groupBy argument on a queryable field to group data and apply functions like sum, avg, and count in a single query.

Example 1: Total Products by Category

query {
  products {
   groupBy(fields: [category_id]) 
   {
      fields {
         category_id # grouped key values
      }
      aggregations {
        count(field: id) # count of products in each group (count of "id")
     } 
   }
  }
}

This returns aggregated results grouped by category, similar to what you might see in a pivot table.

{
  "data": {
    "products": {
      "groupBy": [
        {
          "fields": {
            "category_id": 1
          },
          "aggregations": {
            "count": 3
          }
        },
        {
          "fields": {
            "category_id": 2
          },
          "aggregations": {
            "count": 2
          }
        },
      ...
      ]
    }
  }
}

Example 2: Calculate sum of prices and average ratings

query {
  products {
   groupBy(fields: [category_id]) 
   {
      fields {
         category_id
      }
     aggregations {
        count(field: id)   # number of products in the category
        sum(field: price)  # total of all product prices in the category
        avg(field: rating) # average rating of products in the category
     } 
   }
  }
}

In addition to counting, you can also calculate sums and averages for different fields group by product categories:

{
  "data": {
    "products": {
      "groupBy": [
        {
          "fields": {
            "category_id": 1
          },
          "aggregations": {
            "count": 3,
            "sum": 2058.98,
            "avg": 4
          }
        },
        {
          "fields": {
            "category_id": 2
          },
          "aggregations": {
            "count": 2,
            "sum": 109.94,
            "avg": 4
          }
        },
        ...
      ]
    }
  }
}

Built for Simplicity and Scale

Just like the rest of Fabric API for GraphQL, Aggregations are strongly typed and schema-aware. You get discoverable field names and backend query optimizations — all with the flexibility of GraphQL.

Try It Today

Aggregations are available now for supported data sources via Fabric API for GraphQL. You can find more information about Fabric GraphQL Aggregations, including additional examples, in our documentation.

Ready to summarize your data faster? Give the aggregations feature a try and let us know what you think! Submit your feedback to Fabric Ideas.

関連するブログ記事

Introducing Aggregations in Fabric API for GraphQL: Query Smarter, Not Harder

3月 4, 2026 作成者: Amir Jafari

We’re announcing an update to the permissions required to interact with semantic models in Fabric data agents. Today: As a creator, you must have access to the workspace where the semantic model lives and Build permission on the semantic model to add semantic model to a data agent. As a consumer, you need Read access … Continue reading “Update to required permissions for Semantic Models in Fabric Data Agents”

2月 25, 2026 作成者: Katie Murray

Welcome to the February 2026 Microsoft Fabric update! This month brings a wide range of enhancements across the Fabric platform—from improvements to the OneLake Catalog and developer experiences, to meaningful updates in Data Engineering, Data Factory, Real‑Time Intelligence, and more. Whether you’re building, operating, or scaling solutions in Fabric, there’s plenty here to explore. And … Continue reading “Fabric February 2026 Feature Summary”