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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Gabiiiii
Frequent Visitor

Calculating Yearly Forecast and show it by month in a bar chart

I need to create a bar chart showing the Yearly Forecast for each month -

x axis: Month

y axis: Forecast

Gabiiiii_0-1720685765840.png

 

Forecast = Actual Cost from Jan to previous month + Budget from this month to Dec.

 

The bar chart should show the yearly forecast calculated on monthly basis for both historically and prospectively

 

How to write the DAX function for it? Thank you!! 

2 REPLIES 2
bhanu_gautam
Super User
Super User

@Gabiiiii ,First create a measure for Actual Cost Up

ActualCostToDate =
CALCULATE(
SUM(Financials[ActualCost]),
DATESBETWEEN(
'Date'[Date],
DATE(YEAR(TODAY()), 1, 1),
EOMONTH(TODAY(), -1)
)
)

 

BudgetCostToEndOfYear =
CALCULATE(
SUM(Financials[BudgetCost]),
DATESBETWEEN(
'Date'[Date],
EOMONTH(TODAY(), 0) + 1,
DATE(YEAR(TODAY()), 12, 31)
)
)

 

YearlyForecast = [ActualCostToDate] + [BudgetCostToEndOfYear]

 

Use Yearly Forecast measure in Y axis




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi bhanu, really appreciate your reply! However, I have tried similar approach, it will only show the month-on-month value if I use month as the x axis. I need to show the yearly value for each month, 

for example:

Jan: Budget from Jan-Dec

Feb: Actual for Jan + Budget from Feb-Dec

...

Also, I do not have a date column to use, only a single "month“ column in text format

 

I've tried with AllExcept function, it's also not working as expected...

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.