Just checking back in since we haven’t heard from you in a bit. I wanted to see if the guidance shared earlier helped resolve your question, or if you found a solution in the meantime.
If you still have any additional questions related to your initial post, feel free to share them. Otherwise, any update you’re able to provide within the next 3 business days would be helpful for the community.
Hi @premkup
I think the issue here is due to mixing aggregation levels in the calculation.
In your current formula, you’re using sumOver(...) for the current values, but inside the lag() function you’re using sum(...). These operate at different levels in QuickSight, which leads to inconsistent results or the calculation not working as expected.
To fix this, you should keep the aggregation consistent across the entire calculation. Since you’re already using sumOver, you should also use sumOver inside the lag() function.