Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Applying historical data to forecasts

Hi All,    I am wondering if it is possible to use historical figures to apply to future forecasts. More specifically I have historic demand and historic delivery data by month and so know what % ...
  • Anonymous's avatar
    Anonymous
    7 years ago

    HI Anonymous,

     

    You can write variable to get current date and previous date, then use them to find out corresponded record and calculate the rate.

    Forecast Delivery=
    VAR currDate =
        MAX ( Historical[Date] )
    RETURN
        CALCULATE (
            SUM ( Historical[Demand] ),
            FILTER (
                ALLSELECTED ( Historical ),
                YEAR ( [Date] ) = YEAR ( currDate )
                    && MONTH ( [date] ) = MONTH ( currDate )
            )
        )
            * CALCULATE (
                SUM ( Historical[Delivery] ) / SUM ( Historical[Demand] ),
                FILTER (
                    ALLSELECTED ( Historical ),
                    YEAR ( [Date] )
                        = YEAR ( currDate ) - 1
                        && MONTH ( [date] ) = MONTH ( currDate )
                )
            )
    

    If above not help, please share some sample data with same data structure for test.

     

    Regards,

    Xiaoxin Sheng