The values represent Total $$ Shipped in the quarter, broken down by week (13 weeks in a quarter). I need a calculation that can look back over the last 4 complete quarters (2017-Q2, 2017-Q3, 2017-Q4, 2018-Q1) and give me an average but WITHOUT using a filter.
I can get what I need if I have a filter in place. For instance, here are the correct averages if I used a filter:
But I need this to be automatic so when the next quarter is complete, it adjusts and the user doesn’t have to constantly change the filter.
NOTES: The “Week Number” refers to the week number in the quarter. Also, we use a 4-4-5 fiscal calendar and yes, I have a DATE table which is set up for fiscal dates.
Your measure gave me the same results that my original measure did. It did not show the last 4 quarters, it showed everything UNLESS you used a filter. I know that doesn’t make sense logically because of the TOPN calc, but that’s what it did. Here’s my measure:
Rolling Quarterly Avg. Last 4 =
AVERAGEX(
TOPN( 4, VALUES( PBI_FSCAPF[YEAR-QTR] ), sum( PBI_FSCAPF[YearQtr]), DESC ),
[Book-Ship Qtr] )
where PBI_FSCAPF[YEAR-QTR] = “2018-Q1” and where PBI_FSCAPF[YearQtr] = 20181 and where [Book-Ship Qtr] = $$ items shipped in a quarter.
I did solve this, but probably in a klunky way. I created measures for CURRENT QTR, PREV QTR, PREV QTR-1, PREV QTR-2, and PREV QTR-3. Then I added the values that would be put into each of those buckets and divided by 4. Here’s my result which now works: