This Knowledge Base article describes how to create a derived metric that can use the whole dataset of the report, rather than the default functionality of using the grid dataset using the Lag function as an example.
ACTION:
See below for steps to create a derived metric that can calculate lag on the whole dataset of the report. In order to do this you will need to:
1. Create Sum of Revenue derived metric and 2) Create a Lag of Sum of Revenue derived metric.
Sample report to be used –

2. Create a Sum of Revenue derived metric that looks like this by right clicking the Revenue Metric from the Report objects folder and select Insert Metric… and create the metric as described below:


3. Create a Lag of Sum of Revenue with these settings:


4. Derived metric Lag of Sum of Revenue uses the dataset Jan 2014-June 2016 but the view filter is only July 2014-Apr 2015 and behaves correctly. The calculation for the lag function started at Jan 2014 but only values from July 2014 are seen.
