Something like this:
LOAD Max(TYQUARTER1) as MaxQ1 // or MaxString()?
Let v12Quarters = Peek('MaxQ1') - 11;
DROP Table Temp_MaxQ1;
If(TYQUARTER1 >= v12Quarters), TYQUARTER1, Null()) as DIM_12QUARTERS,
But unlike the front end expression, this is not dynamic.
Thanks for the Quick Reply. Its working and i am getting last 12 Quarters.
As you mentioned it is not dynamic, would like to clarify if it would always take 12 Quarters moving forward. If i move to next year 2018-Q1 its should start counting Quarters from 2018-Q1 to 2015-Q2
Please clarify my doubt.