Dataset is from a csv file with the following data.
invoicedate,Product,Sales SGD,month
1/11/2024,A,100,1
1/11/2024,B,200,1
2/12/2024,A,300,2
2/12/2024,C,400,2
3/13/2024,A,500,3
3/13/2024,B,100,3
4/14/2024,A,200,4
4/14/2024,B,300,4
5/15/2024,A,400,5
Calculated field SalesPrevMth is created as “lag(sum({Sales SGD}), [invoicedate ASC], 1, )”
Pivot table is created as below and working fine.
Hi @lbl,
The February values (or rather January’s since it’s previous month), is not populating because the lag calculation is a table function; meaning it can only access the data that’s not filtered out.
Below is a really useful guide to order of operations within QuickSight as well as a further breakdown of various Period over period computations.
Check these out and let me know if you have any additional questions.