# Rolling SUM as DAX measure



## hobeee (Jul 7, 2014)

I am trying to SUM my SALES_AMT for the last 12 months as a rolling amount IF there is an entry OR NOT equal to "" (blank).
I am not sure how to correctly write the filter. Below I give an example. 

=CALCULATE(sum(FSales[SALES_AMT]), DATESBETWEEN(DateTable[DateKey],FIRSTDATE(PARALLELPERIOD(DateTable[DateKey],-11,month)),lastDATE(PARALLELPERIOD(DateTable[DateKey],0,month))))


I have the relationship between the FSales and Datetable as many (date) to one (date).
 I want my powerpivottable to read : 

2014 January1 or more period w/o sales2014 February1 or more period w/o sales2014 March1351.52014 April1258.42014May1234.62014June1324.3

<tbody>

</tbody>

FSales table :

1/1/201361.91/15/201310.11/29/201353.12/12/201335.62/26/201369.43/12/20133/26/201321.34/9/201387.94/23/201325.15/7/201355.05/21/201376.66/4/201334.56/18/201310.17/2/201371.87/16/201386.97/30/201338.48/13/201363.98/27/201362.39/10/201338.29/24/201380.410/8/201355.610/22/201328.511/5/201347.211/19/201364.312/3/201350.312/17/201310.112/31/201360.21/14/201448.21/28/201450.22/11/201422.22/25/201478.53/11/201410.83/25/201494.64/8/20141.94/22/201418.15/6/201449.25/20/201458.56/3/201445.56/17/201478.7

<tbody>

</tbody>


----------



## scottsen (Jul 8, 2014)

Your formula read pretty well to me.  It's unclear what problem you are having?

This article may help?  Rolling 12 Months Average in DAX | SQLBI


----------

