TOTALMTD and TOTALQTD work like TOTALYTD: they add up from the start of the month or quarter to the last date in the current filter context.
A rolling period is a window that moves with the row: the last 3 months, the last 12 months, the last 30 days. DATESINPERIOD(Dates, End, -3, MONTH) returns the dates in the 3 months ending on End. Use the last visible date as the end:
CALCULATE([Total Sales], DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -3, MONTH))
Edge cases to watch. A window in January reaches back into the previous year, which only works with a proper date table. The first months of the data have less history than the window, so a rolling 12-month total in March 2024 covers three months, not twelve. And a positive number looks forward instead of back.