Forum Discussion

Fyouri's avatar
Fyouri
Frequent Visitor
10 years ago
Solved

Problem with running total

I have a list where i keep track of the total number of hours worked in a company per month. I need to get a sum of the last 12 months  on each row. This is what i would want:   Date              T...
  • sdjensen's avatar
    10 years ago

    You could try something like this:

     

    CALCULATE(
    	SUM( 'Table'[Total Hours] ),
    	DATESBETWEEN(
    		'DateTable'[Date],
    		NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'DateTable'[Date]) ) ),
    		LASTDATE ( 'DateTable'[Date] )
    	)
    )