Skip to main content
Solved

Select N Number of Months Back

  • January 22, 2025
  • 2 replies
  • 133 views

Forum|alt.badge.img+3

I am trying to select N number of months back fin a given metric based on an in Input Metric.

 

The Target Metric is dimension by Type in the rows and Month in the Column. The Input metric is dimensioned by Type and I have assigned a differing number of months to each type. The Calculation Metric in which I am placing the Formula should offset and select the value N Number of Months back based on the Input Metrics Months.

Here is an example formula:

Formula Metric:

‘TargetMetric’[SELECT: Month - InputMetric] but this throws an error about the month dimension.

How can I select a certain value from the target metric N number of months back based on an Input Metric?

Best answer by Min Li

Hi ​@LAS ,

The only thing you need to ensure is that the data type of the InputMetric is integer,.

 

2 replies

Chahat
Master Helper
Forum|alt.badge.img+14
  • Master Helper
  • January 23, 2025

Hi ​@LAS , 

Well, I would suggest you to ulilize PREVIOUS function with offset if it works for you.
Here’s the link for official documentation: 

 


Min Li
Master Helper
Forum|alt.badge.img+12
  • Master Helper
  • Answer
  • January 28, 2025

Hi ​@LAS ,

The only thing you need to ensure is that the data type of the InputMetric is integer,.