Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
sclement
Regular Visitor

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)

 

Screen Shot 2022-06-25 at 9.17.22 pm.png

 

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 6
ALLUREAN
Solution Sage
Solution 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.




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




v-zhangti
Community Support
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]))

vzhangti_2-1656404693035.png

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

vzhangti_0-1656403450803.png

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

vzhangti_1-1656404466819.png

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.

 

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!

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

ribisht17
Super User
Super User

@sclement 

 

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 

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!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.