Forum Discussion
Last four quarters rate
- Anonymous7 years ago
If I understand you correctly you want to put all the Dates in to a YYYYQ format:
(YQ = Concatenate(DateField.[Year], Concatenate("Q", DateField[QuarterNo])) As a Column
Then you want a Total of the last 4 Quarters
(L4QrAll = Calculate(Sum(ValueColumn), Filter(All(TableName), YQ = // This is where I cannot make it dynamic however it will work but you will have to change it when we enter a new quater// "2019Q2" || YQ = "2019Q1" || YQ= "2018Q4" || YQ= "2018Q3")) As a Measure
Then a Measure for the Group Values
(L4QrEach = Calculate(Sum(ValueColumn), Filter(TableName, YQ = "2019Q2" || YQ = "2019Q1" || YQ= "2018Q4" || YQ= "2018Q3")) As a Measure
Finally the Rate
Rate = Divide(L4QrEach, L4QrAll) As a Measure
Note: This will not create a table like the one you had. This is due to level of detail. However, if you create a table like yours without the YQ field it will aggregate to the group level.
I hope this helps
This is the data I created to test it.
I do not see why not. Duplicate the measure and give it a try. Maybe give Today() a try instead of MAX(date). I think either will work.
Anonymous wrote:I do not see why not. Duplicate the measure and give it a try. Maybe give Today() a try instead of MAX(date). I think either will work.
After calculate last four quarters for adding up, how can I subset the last value in each group....