Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Rolling Sales Forecast

Dear all,

 

I would like to calculate the sales forecast of future months based on the historical previous 6-month sales data, like this:

Can you advise? Thanks

MonthProductSales Amount MonthProductSales Forecastmethodology
JanApple100 JulApple232= (total of previous 6-month sales) / 6
JanOrange200 JulOrange258
JanMango350 JulMango367
FebApple540 AugApple254
FebOrange200 AugOrange267
FebMango320 AugMango370
MarApple300     
MarOrange455     
MarMango500     
AprApple150     
AprOrange290     
AprMango333     
MayApple200     
MayOrange200     
MayMango350     
JunApple100     
JunOrange200     
JunMango350     
  • Anonymous , hope you have date, and or create a date using month year

    with help from date table

    Rolling 6 till this month

    Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))

     

    Rolling 6till last month

    Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-1) ,-6,MONTH))

     

    for month

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

     


    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

3 Replies

  • Anonymous , hope you have date, and or create a date using month year

    with help from date table

    Rolling 6 till this month

    Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))

     

    Rolling 6till last month

    Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-1) ,-6,MONTH))

     

    for month

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

     


    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Dear,

       

      I encounter the following error, do you know how to fix it?

       

      A function 'DATESINPERIOD' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for your help