Here It is:
Using Superstore Data you need a parameter and This Calculation to achieve that:
For last 2
For Last 3
and So non
Here are other calcs, I used
Please See attached
If It Helps, pl mark it Helpful and CORRECT to Close Thread
Total by Parameter.twbx 1.2 MB
If you do
...it will add up the two values, the prior and the current, along all cells on the line.
So you can do:
WINDOW_SUM(SUM([Sales],-([your parameter]-1) ,0)
Notice that I put a negative sign in front of [your parameter]-1
If the param is set to 2, then the syntax will do negative 1 (which is the parameter minus 1) for the start position, and you will get 2 cells added for each cell, along the row.