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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nywi6100
Frequent Visitor

Select the next number of months to display

I am working on some Day's Inventory on Hand measures. In order to do this, I need to select the next four months of forecast and get them to display by month in a visual. For example:

 

We are currently in June. So I need to select June, July, August, and September from the forecast data. In the visual, I want to display Each month with it's forecast quantity. Then, when I roll into July, I want the visual to display the next four months of visual forecast (i.e. July thru October). I do not want to use filters to do this. 

 

I have a Fiscal Date table which has the date, month, year, month number 1-12). My thought was to add a calculated column as a yes/no for the "Next Four Forecast". But not sure how to get there. 

 

So fields available:

Forecast Quantity

Date

Fiscal Month

Fisal Year

Fiscal Month Number

2 REPLIES 2
camargos88
Community Champion
Community Champion

Hi @nywi6100 ,

 

Another way would be using what if parameter.

You can calculate the number of months dynamically.

 

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-what-if



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

Proud to be a Super User!



lbendlin
Super User
Super User

yes, calculated column is the way to go. Let's assume you have a FiscalMonth column in your Fiscal calendar table.

 

NextFourMonths = 
var d=Dates[date]
var s=SELECTCOLUMNS(filter(Dates,Dates[date]>=EDATE(d,1) && Dates[date]<=edate(d,4)),"FMonth",Dates[Fiscal Month])
return concatenatex(distinct(s),[FMonth],",",[FMonth],ASC)

 

This is slow as molasses but it may give you some ideas how to tackle the issue. EDATE seems an innocent choice here but it is actually pretty smart, handling month math nicely even with different length months.

 

 

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.