Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sureshcu
Helper I
Helper I

Moving sum

Hi,

 

I have data from 2005 to till data. I want to show last twelve months rolling total wherein previous years total to be added.the following measure is showing only month on month total. but it is not counting previous years total. 

 

Months From Today = IFERROR(DATEDIFF('WF PER028-Employee Detail'[Hire Dt - Most Recent],TODAY(),MONTH),-1)

 

Example: It has to show total till Sep-16 from 20015 Plus Aug-16 total. Similarly For Sep-16. it should show Aug-16 plus Sep-16.

 

Aug-16, Sep-16, Oct-16, Nov-16, Dec-16, Jan-17, Feb-17, Mar-17, Apr-17, May-17, Jun-17, Jul-17

 

 

1 REPLY 1
TomMartens
Super User
Super User

Hey,

 

I have to admit, that do not fully understand your requirement so for this reasom I'm not sure if this is what you are looking for.

Here you will find an example.

 

On the report page you will find an example for y rolling sum, that is calculated with this measure:

Rolling Sum last 12 Months = 
var endDate = CALCULATE(MAX('Calendar'[Date]))
var startDate = MAXX(DATEADD('Calendar'[Date], -12, MONTH),'Calendar'[Date])
return
CALCULATE(
	SUM('FactWithDates'[Amount])
	,DATESBETWEEN('Calendar'[Date],startDate,endDate)
)

Please be aware, that the report shows Month whereas the Measure considers day, so for this reason it is not valid to add up the depicted Months 😉

 

Hope this helps

Regards



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.