Forum Discussion
Dynamic Before Previous Month and Further
- 2 years ago
Deligraphs Use PARALLELPERIOD to go back specific numbers of months, quarters, or years:
When calculating values for previous periods, apply the PARALLELPERIOD or DATEADD functions directly in your calculation measure:
aPrevNSOPrevHeadroomOutstanding_92 =
VAR PrevPeriod = CALCULATE(MAX('04DateTable'[Date]), PARALLELPERIOD('04DateTable'[Date], -3, MONTH))
VAR Calc = SUM(Sample) * 1000000
VAR Results = CALCULATE(Calc, '04DateTable'[Date] = PrevPeriod)
RETURN ResultsAdjust PARALLELPERIOD to MONTH, QUARTER, or YEAR as needed, based on your report’s date structure. This method should yield correct results for each report date, regardless of the period gaps.
Deligraphs Hope it works.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Deligraphs Use PARALLELPERIOD to go back specific numbers of months, quarters, or years:
When calculating values for previous periods, apply the PARALLELPERIOD or DATEADD functions directly in your calculation measure:
aPrevNSOPrevHeadroomOutstanding_92 =
VAR PrevPeriod = CALCULATE(MAX('04DateTable'[Date]), PARALLELPERIOD('04DateTable'[Date], -3, MONTH))
VAR Calc = SUM(Sample) * 1000000
VAR Results = CALCULATE(Calc, '04DateTable'[Date] = PrevPeriod)
RETURN Results
Adjust PARALLELPERIOD to MONTH, QUARTER, or YEAR as needed, based on your report’s date structure. This method should yield correct results for each report date, regardless of the period gaps.
Deligraphs Hope it works.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!