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
aroberts27
Frequent Visitor

Next month forecast value in a measure

Hello,

 

I have a table that appends monthly forecast update versions together, each labeled in ascending order. For instance, Jan forecast is '202201', Feb is '202202', and so on. 

 

I am trying to create a measure that both grabs the most recent forecast for all contexts (essentially filtering the table for the max version) AND to grab next month's value. So for instance, in the table below, I would want the "Next Month" measure to take the 202210 version and show the November forecast in the October column. I have tried a few versions of the formula pasted below, but the 'This Month' and 'Next Month' versions always match

 

Thanks!

 

Current formula:

Next Month =
VAR ForecastVersion = CALCULATE(MAX('2022ExceedraForecasts'[Version]), ALLSELECTED())
VAR Forecast = CALCULATE([ForecastCase], '2022ExceedraForecasts'[Version] = ForecastVersion)
Var NextMonthDate = DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)
VAR NextMonthFcst = CALCULATE(Forecast, Filter('Date','Date'[Date] = NextMonthDate))
Return
NextMonthFcst
 

Current formula output:

aroberts27_0-1665438300449.png

 

2 REPLIES 2
aroberts27
Frequent Visitor

Ah thanks for your response

 

Follow-up question:

The table that appends monthly forecast update versions together (the one where I only need the most recent version, so 202210 right now) is pulled into my model from another Power BI dataset from my organization. 

 

Can I pre-filter this table so only the version of the forecast I need  is included in this model from the full table in the other model? This would eliminate the need for the calculation above. I can't use power query because its a Direct Query, but wondering if there is a workaround that would allow me to grab only the data I need.

 

Thanks! 

wdx223_Daniel
Super User
Super User

in dax, a variables is fixed after it is calculated, you put the Forecast in the 1st parameter of calculate, that will not change the value of Forecast. it always gives the value of CALCULATE([ForecastCase]'2022ExceedraForecasts'[Version] = ForecastVersion)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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