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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BIlix
Helper II
Helper II

Need help with a forecast Measure

I have a forecast measure which should return a value based on a Sum(FactTable[Cost] YTD measure.

A cost value in my fact table is always assigned to the end of a month.

Currently The Forecast only calculates a value for the end of the Year or, if its earlier, until the end of a project.
Here, it calculate the difference from the last refresh column of the fact table until end of project or end of year.

Now I need to adjust the measure to show values not only for the end of the year, but for every end of the month until the end of the year or Project.

For example, I have Months in Row and the Forecast Measure. It should return The YTD Cost measure for every Month until end of August. Afterwards it should display the Forecast measure over all Projects For End of September, October, November, December.

Forecast =
    VAR CurrentYear = YEAR(TODAY())
    VAR LastDayOfYear = DATE(CurrentYear, 12, 31)
    VAR ProjectEndDate = IF(ISBLANK(MAX(DimProject[Planned Finish])), LastDayOfYear, MAX(DimProject[Planned Finish]))
    VAR DaysPassed = IF(ProjectEndDate < DATE(CurrentYear, 1, 1), 0, DATEDIFF(DATE(CurrentYear, 1, 1), ProjectEndDate, DAY))
    VAR RemainingDays = IF(ProjectEndDate > LastDayOfYear, 0, DATEDIFF(MAX(Fact[RefreshDate]), ProjectEndDate, DAY))
    VAR CurrentActual = [Costs]
    VAR AverageCostPerDay = CurrentActual / DaysPassed
    VAR ForecastedAmount = [Costs YTD] + (AverageCostPerDay * RemainingDays)
    VAR Calc = IF(ProjectEndDate < MAX(Fact[RefreshDate]), CurrentActual, ForecastedAmount)
    RETURN
 Calc

Thanks in Advance
2 REPLIES 2
technolog
Super User
Super User

I hope this message finds you well. I've noticed that this solution remain unresolved. If any of you have managed to find a resolution to the issue, I kindly request that you share your solution for the benefit of the entire community. Alternatively, if you're still facing challenges, please do let us know as well.

Your insights and updates will greatly assist others who might be encountering the same challenge.

some_bih
Super User
Super User

Hi @BIlix I suggest you to read, if not already, article and video from link. After that go to your model, and think how to resolve your issue. Hope this help, kudos appreciated.

https://www.sqlbi.com/articles/showing-actuals-and-forecasts-in-the-same-chart-with-power-bi/ 





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

Proud to be a Super User!






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.