Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help please - datesinperiod question

Hi,

 

I have this formula:

 

Test = CALCULATE(average(Rental_Net), DATESINPERIOD('Date'[Date], max('Date'[Date]),-12,MONTH))
 
I want to be able to change the constant 12 to a formula depending on the date I selected on the date slicer from calendar table. The problem is when I select 9 calendar months for example:
 

it still gets the average for the last 12 because of the constant 12. Is there a way to "macro" the 12? Thanks! 

 

1 Reply