I want to calculate Growth Rates with the PREVIOUS function, but suddenly it doesn’t work as expected.
This is my simple Test Metric:
Calculating the Growth with PREVIOUS does not work:
However, selecting the previous Year with SELECT does work:
I would expect the PREVIOUS function to select exactly the same cell as the SELECT function. Am I doing something wrong here?
Page 1 / 1
Hi @MARCO_BMG,
In this scenario, the SELECT function is the best option. The PREVIOUS() function operates on the metric itself using the expression (‘Test Metric’ / PREVIOUS(Year)) - 1. Consequently, FY23 will be empty because PREVIOUS(Year), which refers to FY22 in this case, is also empty.
Let's say you initialize it with FY23 = 1. Then, the expression (‘Test Metric’ / PREVIOUS(Year)) - 1 will result in:
FY24: (15 / 1) - 1 = 1400%
FY25: (17 / 14) - 1 = 21.43%
FY26: (20 / 0.2143) - 1 = 9233.33%
This approach will mix the growth of growth and the underlying metric itself, which is not accurate at all.
Note that you could achieve the same result as SELECT with PREVIOUSBASE() by setting the iterative calculation to ‘Test Metric’. However, in terms of performance, PREVIOUSBASE() is slower.