Forum Discussion
BGB
Helper II
4 years agoCurrent Month Day No Forecast
Hi All, I'm doing forecast figures for some projects and I have been asked that in the current month (in this case March 2022) when the date is below the 15th the forecast figure should be Previo...
- 4 years ago
How about now? Tomorrow it will be 485 😁
Measure = SWITCH ( TRUE(), AND ( SELECTEDVALUE('Date'[Month_no]) < MONTH(TODAY()), SELECTEDVALUE('Date'[Year]) <= YEAR(TODAY()) ), SUM('Budget Actual'[Actual Cost]), --Before Active Month AND ( SELECTEDVALUE('Date'[Month_no]) > MONTH(TODAY()), SELECTEDVALUE('Date'[Year]) >= YEAR(TODAY()) ), [Actual and forecast], --After Active Month TODAY () < DATE ( YEAR(TODAY()), MONTH(TODAY()), 15 ), [Actual and Forecast PM], -- Active Month, Before 15 SUM('Budget Actual'[Actual Cost]) -- Active Month, After 15 )
coskuersanli
Resolver III
4 years agoI've changed it a little, this should work.
SWITCH
(
TRUE(),
AND
(
MONTH(dates_table[date]) > MONTH(TODAY()),
YEAR(dates_table[date]) > YEAR(TODAY())
),
budget,
TODAY <=
DATE
(
15,
MONTH(TODAY()),
YEAR(TODAY())
),
previous_month,
actual_forecast
)
BGB
Helper II
4 years agocoskuersanli Thanks for looking at this.
When I tried this in a measure it won't accept 'Date'[date] and when I tried to use it as a column it didn't accept today
line 7..
- coskuersanli4 years ago
Resolver III
Can you put () after TODAY and try again? 🙂
- BGB4 years ago
Helper II
coskuersanli Apologies if I'm starting to sound thick. I have left a screen short to this. I wonder why I'm not allowed to upload the PBIx file.
Picture 2 shows the switch didn't happen. Also, I had to use the date within my dataset as datetable date was not allowed (Didn't come up)
March 2022 should be showing PM figure.The column formula