Tuesday, November 10, 2026

Rolling Period Calculation - DATESINPERIOD

 Sometimes , we have to calculate total amount for rolling 12 month/rolling 3 month.

For such rolling period calculations, we can use Time intelligence function "DATESINPERIOD"


Rolling 3 month Sales =

VAR vMaxSalesDate = MAX(Sales[OrderDate])

RETURN
CALCULATE([Sales Amount], DATESINPERIOD(dim_date[Date], vMaxSalesDate, -3,MONTH))

No comments:

Post a Comment