Hi everyone, I have this code getting the rolling 12 months. However, I am having a hard time incorporating it having with the financial year and month slicer. Say, I selected FY23 and Oct, the calculation will be 12 months backwards. Showing future dates as well is killing me Here’s my code.
Rolling 12 Months =
VAR EndDate =
MAX( 'Date'[Date] ) -- retrieves MAX Date
VAR StartDate =
EDATE( EndDate, -12 ) + 1 -- shifts EndDate to year beginning
VAR Result =
CALCULATE(
[Total Sales By Team (Accounting) MTD],
-- retrieves the relevant date range
DATESBETWEEN( 'Date'[Date], StartDate, EndDate )
)
RETURN
Result