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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
benaford
Frequent Visitor

Can't get chart to plot forecast

I'm trying to create a chart that compares current units sold by week to forecasted units across the same time and then plots the forecast out for the rest of the year. However, I have three tables - Sales, Forecast and Calendar. When I try to plot current year the forecast will only plot out as far as the current week of sales, but not any further. 

 

This is last year - it will force the forecast line to plot across all 52 weeks:

benaford_0-1659067774686.png

This is current year - forecast will only plot out to the last week where there are sales recorded:

benaford_1-1659067959061.png

 

I feel like this has something to do with the calendar and the filters, but I can't figure it out. I'm a newbie to this, so I apologize in advance is this is something super simple that I'm not aware of.

 

TIA ~

 

https://1drv.ms/u/s!Aq5qm0GeT2XSgqdfVf9AT4fXWYm28A?e=0JOoDh

1 ACCEPTED SOLUTION

Hi @benaford 

 

I made several changes to your pbix. Please download the attachment at bottom to see details. Changes are: 

 

1. Remove the old relationship between Sales and Forecast tables. Add a one-to-many relationship from Calendar to Forecast. The old relationship uses Sales table to filter Forecast, which caused the data missing as Sales table doesn't have data past week 22. Using Calendar table to filter Forecast can avoid this. 

 

2. Add a Dim Item table to the model and create one-to-many relationships from it to both Sales and Forecast tables on Item Nbr or Item Name columns. Use DimItem's Item Name in the slicer on report. 

vjingzhang_0-1659582055749.png

 

3. Remove FISCAL YR from the visual. Then you will have the following visual as expected. 

vjingzhang_1-1659582796230.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

9 REPLIES 9
benaford
Frequent Visitor

Amazing job! Thank you! Can I just ask what purpose the Dim Item Table serves in this solution? 

Hi @benaford 

 

The Dim Item table is used to filter both Forecast and Sales tables. The relationship between Forecast and Sales has been modified, so the Forecast (or Sales) table cannot filter the other table using its Item Name column correctly. Using a Dim table can avoid a scenario that when one item exists in Forecast (or Sales) but doesn't exist in the other table, which would cause data missing in a visual. There is a concept of modeling -- Start schema. You can refer to Power BI Basics of Modeling: Star Schema and How to Build it - RADACAD 

 

Best Regards,
Community Support Team _ Jing

benaford
Frequent Visitor

I still haven't solved the problem, even after updating the calendar table. Any suggestions are welcome...

Hi @benaford 

 

Your current Forecast table only has forecast units till week 202222. To display forecast unit values later than week 202222, you need to have those values in the table. It cannot display nonexistent data. 

vjingzhang_0-1659507413592.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Jing - that makes a lot of sense, thank you! However, even adding forecast for weeks 23-52, I still can't get the graph to plot past week 22:

 

benaford_0-1659540929046.png

Here's a glimpse of my forecast table weeks:

benaford_1-1659540983698.png

 

What is going on here?

 

https://1drv.ms/u/s!Aq5qm0GeT2XSgqdgqIj3GwPOcKOL7w?e=Tq7mRN

 

 

Hi @benaford 

 

I made several changes to your pbix. Please download the attachment at bottom to see details. Changes are: 

 

1. Remove the old relationship between Sales and Forecast tables. Add a one-to-many relationship from Calendar to Forecast. The old relationship uses Sales table to filter Forecast, which caused the data missing as Sales table doesn't have data past week 22. Using Calendar table to filter Forecast can avoid this. 

 

2. Add a Dim Item table to the model and create one-to-many relationships from it to both Sales and Forecast tables on Item Nbr or Item Name columns. Use DimItem's Item Name in the slicer on report. 

vjingzhang_0-1659582055749.png

 

3. Remove FISCAL YR from the visual. Then you will have the following visual as expected. 

vjingzhang_1-1659582796230.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

When I removed the relationship between Sales and Forecast and replaced it with a one-to-many between Calendar[WEEK] and Forecast[WEEK], it seems to work. 

benaford
Frequent Visitor

Oh yes. I had my calendar offset by a year. Ok, I fixed that and it's still not plotting the forecast by week out past the last week of current year. Not sure if I was clear in my original post, but here's what I'm wanting PBI to do:

benaford_0-1659104836695.png

 

I fixed the calendar issue and updated my pbix file here: Sample PBIX file 

 

 

amitchandak
Super User
Super User

@benaford , Check your calendar table , it need to have future date

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.