Forum Discussion

ravi_ch's avatar
ravi_ch
Icon for Helper I rankHelper I
4 years ago
Solved

Forecast for next 1 year

  1. I want to forecast from 4/10/2021 to 31/12/2022 Using last year data + 10% for forecast.
    For that first i calculated forecast amount Then i use if statement like if date is greater than 3/10/2021 use forecast If not use normal data
     
    But for me if statement not working it produces two line

    can someone help it

  • Hi  ravi_ch ,

     

    Modify "3/10/2021" as Date(2021,3,10),see below:

    Web search Interest Forecast (Power BI) =
    VAR Forecast =
        CALCULATE (
            [AVG websearch Interest (Power BI)],
            DATEADD ( 'Date table'[Date], -1, YEAR )
        ) * ( 1 + 0.1 )
    RETURN
        IF (
            MAX ( 'Date table'[Date] ) > DATE ( 2021, 3, 10 ),
            Forecast,
            [AVG websearch Interest (Power BI)]
        )
    

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my reply as a solution!

4 Replies

  • Hi,

    What does your raw inout data look like?  Share that and show the result in a simple Table format.  Once we get the result in a Table format, we can build any other chart/visual that we want.

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Icon for Super User rankSuper User

      Share that and show the result in a simple Table format.  Once we get the result in a Table format, we can build any other chart/visual that we want.

  • v-kelly-msft's avatar
    v-kelly-msft
    Icon for Community Support rankCommunity Support

    Hi  ravi_ch ,

     

    Modify "3/10/2021" as Date(2021,3,10),see below:

    Web search Interest Forecast (Power BI) =
    VAR Forecast =
        CALCULATE (
            [AVG websearch Interest (Power BI)],
            DATEADD ( 'Date table'[Date], -1, YEAR )
        ) * ( 1 + 0.1 )
    RETURN
        IF (
            MAX ( 'Date table'[Date] ) > DATE ( 2021, 3, 10 ),
            Forecast,
            [AVG websearch Interest (Power BI)]
        )
    

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my reply as a solution!