periodOverPeriod calculations not showing in the Totals for Columns

Hi everyone,

I used this trick to hide rows in my pivot table and filter only visually.
It worked great, except 1 problem I have with Totals(Renamed - Net Revenue) for columns.
This is how my table looks like:

The issue I have is that for the following fields:
$ increase vs. last year same month
% increase vs. last year same month
$ increase vs. last year (YTD comparisons)
% increase vs. last year (YTD comparisons)

It seems like the problem is only present on the Column Totals(Renamed Net Revenue), while the columns grouped by category work as expected no matter what is selected in the Date Filter (defined as: minOver(min({Month of Adjusted Date}), [{Month of Adjusted Date}]))
However for totals, it only seems to work for the fields I mentioned when the months that are being compared to are also present in the table.

The formulas I am using for the fields are the following:
For Month:

sumOver(
sum({C Net Amount}),
[{Location Nickname}, {Month of Adjusted Date}, {CName Ordered1}]
)

$ increase vs. last year same month:

periodOverPeriodDifference(
sum({C Net Amount}),
{Month of Adjusted Date},
MONTH,
12
)

% increase vs. last year same month:

periodOverPeriodPercentDifference(
sum({C Net Amount}),
{Month of Adjusted Date},
MONTH,
12
)

Year to Date:

periodToDateSumOverTime(sum({C Net Amount}), {Month of Adjusted Date}, YEAR)

$ increase vs. last year (YTD comparisons):

periodOverPeriodDifference({C YTD$}, {Month of Adjusted Date}, YEAR, 1)

% increase vs. last year (YTD comparisons):

periodOverPeriodPercentDifference({C YTD$}, {Month of Adjusted Date}, YEAR, 1)

Previous Year:

{C YTD$} - periodOverPeriodDifference({C YTD$}, {Month of Adjusted Date}, YEAR, 1)

Thanks in advance!

Hello @rusu2k, out of curiosity, if you were to provide a total for a calculated field like % increase vs last year same month, what would you be expecting it to return? The 4 fields you mentioned are basically a point in time comparison. I think QuickSight wouldn’t understand how to total them, especially if there are partitions within the aggregations you are using to calculate them. Maybe with a little more information I could guide you further.

Something you could also check would be to see what table calculations are provided for the totals of those fields. I am curious if QuickSight will offer a way to manipulate them.

1 Like

Hi @DylanM,
What I would expect for the total calculations to return is what it returns right now for Jan, Feb and Mar 2024.

The values are showing correctly for those fields because Jan, Feb and Mar 2023 are included in the date interval filter control. For example, if I remove the control entirely all the values show correctly. I am trying to find a way to filter by date without losing the totals calculations.

1 Like

Hello @rusu2k, I see, so in your calculations, you are comparing December 2023 with December 2022, and those values are being filtered out when your look back window is set to January 2023, am I correct? If that is the case, you would likely need to utilize LAC-W calculations in order to reference the value from the previous year whether it is used within the visual. We could probably do something where you bring the value you want to reference onto the same row in the pivot table using lag, then aggregate it based on the current month value. I’ll post the documentation below for lag. Otherwise, if you want to keep functionality the same way, you may need to set a calculated field to filter out based on your start date parameter to include a year before the date selected. Those are the 2 most likely options to handle this.