Forum Discussion

sclement's avatar
sclement
Regular Visitor
4 years ago

Help needed with Graph for forecasting

Hi All,

 

I am new to the powerbi graphs for forecasting and I am trying to build a sales data graph in powerbi with the below requirements:

 

1. the x axis with continous dates of a month

2. Sales data for each day in that month( the red line in the below graph produced in 17th of this month,  where '169' is the total sales for the date '17' and after that it is forecasted ) 

3. previous year same month sales data ( solid blue line in the below graph)

 

 

I tried many methods for the last few weeks but no luck. It would be great if anyone of you could help me with the above. Is it possible in powerbi?

 

Thank you in advance.

 

6 Replies

    • sclement's avatar
      sclement
      Regular Visitor

      Hi ribisht17 ,

       

      Thank you for your response. The link you have provided didn't me help that much as I am finding a way to obtain the forcasted MTD sales which was not covered in the post. I want to obtain the forecasted values in my PowerBi report.

       

      Thanks!

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, sclement 

     

    Please try the following methods.

    Measure:

    Preyear = CALCULATE(SUM('Table'[Actual]),DATEADD('Table'[Date],-1,YEAR))
    Current = 
    IF(SELECTEDVALUE('Table'[Date])<TODAY(),SUM('Table'[Actual]),SUM('Table'[forecast]))

    The X-axis can be set in this way to get a continuous date of one month.

    Measure = IF(YEAR(SELECTEDVALUE('Table'[Date]))=YEAR(TODAY())&&MONTH(SELECTEDVALUE('Table'[Date]))=MONTH(TODAY()),1,0)

    June 28 and onwards are shown as forecast values. A line cannot be split to show solid and dashed lines. Does this result match your expected output?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • sclement's avatar
      sclement
      Regular Visitor

      Hi Charlote , v-zhangti 

       

      Thank you for providing me the solution!

      Unforuntely it doesn't help me much as my very first problem is obtaining the Forecasted MTD sales. I couldn't find any appropriate resources or community forum post that helps me in this direction to obtain Forecasted MTD sales per each day.

       

      Any advise on this would be very much helpful for me.

       

      Thank you!

      • v-zhangti's avatar
        v-zhangti
        Community Support

        Hi, sclement 

         

        By what logic do you want to get your sales forecast? Is there a relationship with the previous year's data?

         

        Best Regards