Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

DAX for Prediction

Hi everyone, I’m facing a challenge and would appreciate some guidance. I need to calculate a ratio based on the last three months of data and use that to predict the quantity for the next nine month...
  • Kedar_Pande's avatar
    1 year ago

    Calculate the Last Three Months' Real-Time Quantity:

    LastThreeMonthsQty = 
    CALCULATE(
    SUM(YourData[RealTimeQuantity]),
    DATESINPERIOD(DateTable[Date], MAX(DateTable[Date]), -3, MONTH)
    )

     

    Calculate the Ratio

    Ratio = 
    DIVIDE(
    [LastThreeMonthsQty],
    SUM(YourData[AnnualVolume]),
    0
    )

    Predict Quantity for the Next Nine Months:

    PredictedQtyNextNineMonths = 
    [Ratio] * SUM(YourData[AnnualVolume]) * (9 / 12) // Adjust as necessary based on your prediction logic