Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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! |
|
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 6 | |
| 6 |
| User | Count |
|---|---|
| 20 | |
| 20 | |
| 20 | |
| 14 | |
| 14 |