Forum Discussion
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
- ribisht17Super User
Hope it helps!
Solved: Calculate actual vs Forecast? - Microsoft Power BI Community
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users - v-zhangtiCommunity 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.
- sclementRegular 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!
- ALLUREANSolution Sage
Hi, sclement
Please check my article https://allure-analytics.com/index.php/2022/06/11/combine-actuals-forecast-in-power-bi/
and hope it can help you to achieve the red line (actuals + forecast in one line) and then you can add your Previous Year measure below as line.