The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
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
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.
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |