Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hello I have in my data model: Calendar table, FCT Parameters table, Forecast Costs table. In Forecast Costs table I have data from Jan 2024 till Oct 2024. I want to show data also for missing months.
I made my dax formula to check if it's work and it' ok:
Unfortunately, it does not work
@Jackie003 , Try using below mentioned measure
Forecast =
VAR maxdate = MAX('Calendar'[Date])
VAR currentRule = SELECTEDVALUE('FCT Parameters'[Rule])
VAR result =
SWITCH(
currentRule,
"Average",
CALCULATE(
AVERAGEX(
DATESBETWEEN('Calendar'[Date], DATE(2024, 1, 1), DATE(2024, 10, 31)),
'Forecast Costs'[Quantity]
),
ALL('Calendar'),
'Calendar'[Date] <= maxdate
),
"Prev Month",
CALCULATE(
LASTNONBLANKVALUE('Calendar'[Month], SUM('Forecast Costs'[Quantity])),
ALL('Calendar'),
'Calendar'[Date] <= maxdate
),
// Default case if no rule matches
CALCULATE(
LASTNONBLANKVALUE('Calendar'[Month], SUM('Forecast Costs'[Quantity]) * 1.05),
ALL('Calendar'),
'Calendar'[Date] <= maxdate
)
)
RETURN
result
Proud to be a Super User! |
|
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |