Forum Discussion

JIN23's avatar
JIN23
Icon for Helper I rankHelper I
2 years ago
Solved

Need a help with multiple condition & SQRT Formula

Hi   I want to calculate Forecasted stock gross based on weeks and week diff and here is what I have wrote. Any one confirm if it is correct?   Forecast Stock Gross = IFERROR(calculate([Bought...
  • bhanu_gautam's avatar
    2 years ago

    JIN23 , Try using below mentioned measure

     

    Forecast Stock Gross =
    IF(
    MAX(Dim_WK[week_full_no]) >= MAX(Dim_WK[Launching week]),
    CALCULATE(SUM([Bought Gross]), FILTER(Dim_WK, Dim_WK[week_full_no] >= Dim_WK[Launching week])),
    IF(
    MAX(Dim_WK[week_full_no]) > MAX(Dim_WK[Closing week]),
    CALCULATE(POWER([Closing week diff], [Bought Gross] * (1 - [Speed Plan])), FILTER(Dim_WK, Dim_WK[week_full_no] > Dim_WK[Closing week])),
    IF(
    MAX(Dim_WK[week_full_no]) = MAX(Dim_WK[Closing week]),
    CALCULATE(POWER([Closing week diff], [Stock gross] * (1 - [Speed Plan])), FILTER(Dim_WK, Dim_WK[week_full_no] = Dim_WK[Closing week])),
    BLANK()
    )
    )
    )