Hi,
I have a report where the user can select a date period and see metrics. It contains several KPIs that show the sums of the metrics within that period.
I also want to the KPIs to calculate the percent difference compared to the previous period. Essentially, I want a calculated field that calculates the value of the previous period and use it as the target value of the KPI.
The period should be dynamic based on the date period the user has selected. So, if the user selected a week in the date filter, I want it to calculate the value of the previous week and show the difference to the current week. If the user selected a month, I want it to calculate the difference compared to the previous month.
I have tried measured like this:
periodOverPeriodLastValue(sum({Amount Spent}), Date)
It somewhat works when I put it in a table, select a whole month and aggregate the table by week.
But it doesn’t work when I add it to a KPI, because I get the error: Table calculation attribute references are missing in field wells
and VISUAL_CALC_REFERENCE_MISSING
.
It seems like this approach wouldn’t work even if the reference wasn’t missing, because the date filter would prevent the calculation from getting the previous month.
Is there a way to temporarily disable the filter for a calculation?
This seems to be a super common need and I am really surprised by how difficult it seems to be to create this type of visual.
I am probably missing something super basic, because I am new to QuickSight and I would really appreciate your help.
Thanks and greetings,
Nilcha