Forum Discussion
OhLookAnError
Helper I
2 years agoRolling sum between relative dates?
Hello! I am trying to get a rolling sum between two dates. Normally I would use something like the statement below to just get for example the last 365 days: Revenue Prior 365 Days= Calculate(SUM...
OhLookAnError
Helper I
2 years agoHi, it is just going in a table. So for example, the first column would show the sum of the last 90 days and the next column would show the sum of the 90 days before that.
some_bih
Community Champion
2 years agoHi OhLookAnError possible solution as measure
Running sum test =
CALCULATE (
SUM(tblSummary[Revenue]),
DATESINPERIOD (
'Date'[Date], --this column must be Calendar / Date table in Power BI
MAX ( 'Date'[Date] ),--this column must be Calendar / Date table in Power BI
-1, --change as needed
YEAR --period could Day, Month, Quarter, Year
)
)
- OhLookAnError2 years ago
Helper I
I got this below to work but is there a way to do it in months instead of days?
PreviousPeriod = Calculate(SUM('tbl'[Revenue]),DATESBETWEEN('Calendar'[Date],MAX('Calendar'[Date]) - 180,MAX('Calendar'[Date]) -90))