# Subtotals and XLOOKUP

**URL:** <https://community.omni.co/t/subtotals-and-xlookup/415>\
**Category:** Patterns\
**Tags:** calcs\
**Created:** [November 5, 2025, 9:35pm UTC](https://community.omni.co/t/subtotals-and-xlookup/415 "2025-11-05T21:35:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![James](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@James](https://community.omni.co/u/James)\
**Post date:** [November 5, 2025, 9:35pm UTC](https://community.omni.co/t/subtotals-and-xlookup/415/1 "2025-11-05T21:35:19Z")

</div>

When you add subtotals to a query that uses XLOOKUP calcs, sometimes the subtotal may appear blank on the XLOOKUP field.

 ![Screenshot 2025-11-05 at 13.30.57](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/b2e5bf83bd895af226b2f5c8e43835b555d1c01c.png)

To ensure the subtotal gets calculated correctly, you’ll need to ensure all keys are included in the XLOOKUP calculation.

 ![Screenshot 2025-11-05 at 13.31.33](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/56c32758a84f178de1a8d89ca35cbcab77e9f51c.png)

 ![Screenshot 2025-11-05 at 13.33.02](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/663f91a8333a9176bb363eb02be55183e9601bb1.png)

To XLOOKUP with subtotals into the query above, both the lookup\_value and lookup\_range need to match all dimensions being grouped.

 ![Screenshot 2025-11-05 at 13.33.16](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/41c4ea2330f180e3b193c87d2876042d21ab7d39.png)

> **[Supported position functions | Omni Analytics Documentation](https://docs.omni.co/docs/querying-and-sql/table-calculations/position-functions#xlookup)**
>
> Omni supports cell formulas typically found in most spreadsheet applications such as Google Sheets. This reference details the position functions supported by Omni, which can be used to return data from specified points in a result table.
