How to handle semi-additive measures (account balance / snapshot) when collapsing hierarchy in a Pivot Table?

Hi everyone,

I am building an account balance report in Amazon QuickSight and running into an issue handling a semi-additive measure when collapsing a pivot table hierarchy.

Setup & Business Requirement

  • Visual type: Pivot table

  • Required hierarchy structure: The end user/client specifically requires the hierarchy to start at the customer level and drill/drop down into date (customer → date). Inverting this hierarchy (e.g., placing date first) or splitting it across unrelated tables is not an option for this workflow.

  • Row field wells:

  1. customer (parent / top level)

  2. date (child level)

  • Value field well: account balance

Sample Data:

Each customer has a daily snapshot of their account balance:

The Problem

When the hierarchy is expanded, each individual day correctly reflects the customer’s balance for that date.

However, when a user collapses the pivot table to the customer level, QuickSight aggregates the daily balances by summing them across all dates (e.g., John displays 16, Mary displays 32, Carl displays 48). Because account balances are point-in-time snapshots (semi-additive across time), summing them produces an incorrect and misleading figure.

Desired Outcomes

Maintaining the required customer → date hierarchy, I am looking for a solution that achieves either of the following behaviors:

  1. Option A (Preferred): When collapsed to the customer level, display the last available balance for that customer (e.g., John = 1, Mary = 2, Carl = 3), while still displaying daily balances when expanded.

  2. Option B: Leave the measure cell blank / null when collapsed to the customer level so incorrect additive totals are not presented to business users.

What I’ve Tried

  1. Format visual settings: Disabled row subtotals and row totals under the visual format pane. This removes summary rows at the bottom/top, but it does not change how the parent row cell itself aggregates values when collapsed.

  2. Calculated fields: Experimented with LAC-A / LAC-W expressions (such as lastValue or maxOver), but I haven’t found a clean way to detect the visual’s collapsed aggregate state versus the expanded granular state within the pivot table.

Questions

  1. Is there a recommended LAC expression or calculated field pattern to dynamically return the latest balance or NULL depending on whether the customer row is collapsed or expanded?

  2. Has anyone solved semi-additive measures in QuickSight pivot tables while strictly preserving a parent-to-child (customer → date) drill-down hierarchy?

Any guidance or workaround would be greatly appreciated!

Hi @Robert_Esteves

I don’t think QuickSight visuals have granular control over the level of detail it is dealing with. I have seen that flexibility available in tools like Power BI where you can determine the level at which you are operating and calculate the value accordingly.

What is possible is that for the total level you can select None so it does not show the values.

Hi Robert, @Robert_Esteves

You can make a formula that only keeps the most recent balance and put this in a second colum. This gives correct totals. If you also hide the totals in the first column as Ghiridar showed, you can get the following result:

Hi @Robert_Esteves,

Hope everything is well! Just checking back in since this thread hasn’t received a response in a while. Were @Giridhar.Prabhu and @camaris’s replies helpful to you and/or were you able to find a solution yourself in the meantime? Please help the community by marking this answer as “Solution” or following up in general within the next 3 business days!

Thank you!

Hi @Robert_Esteves,

Since I haven’t received any further updates from you, I’ll treat this inquiry as complete for now. If you have any additional questions, feel free to create a new post in the community and link this discussion for context.

Thank you!