Forum Discussion
ValeriaBreve
Post Partisan
3 years agorunning total from a given date
Hello, I am trying to compute a running total for a forecast per year, but not from the beginning of the year, just from the first date when there are no more actuals. It is shown in a table per mo...
- 3 years ago
Hi ValeriaBreve one of possible implementation is following:
1. In Date table insert column with code
IF([Date]>=EOMONTH(TODAY(),-2), TRUE,FALSE)
2. Measure for forecast is simple sum,M_forecast = sum(Sheet10[Forecast])Adjust Sheet10 to your table name3. Measure for Expected:M_for_Expected =CALCULATE([M_forecast],'Date'[EOM and future]=TRUE)4. Finally, measure for YTD expected amountM_Expected_test =CALCULATE([M_forecast],DATESYTD('Date'[Date]),'Date'[EOM and future]=TRUE)End of Month below is column from Date column tableI hope this help
some_bih
Community Champion
3 years agoHi ValeriaBreve one of possible implementation is following:
1. In Date table insert column with code
IF([Date]>=EOMONTH(TODAY(),-2)
, TRUE,FALSE)
2. Measure for forecast is simple sum,
2. Measure for forecast is simple sum,
M_forecast = sum(Sheet10[Forecast])
Adjust Sheet10 to your table name
3. Measure for Expected:
M_for_Expected =
CALCULATE([M_forecast],
'Date'[EOM and future]=TRUE
)
4. Finally, measure for YTD expected amount
M_Expected_test =
CALCULATE(
[M_forecast],
DATESYTD('Date'[Date]),
'Date'[EOM and future]=TRUE
)
End of Month below is column from Date column table
I hope this help
ValeriaBreve
Post Partisan
3 years agoThanks! This works 🙂
I still don't get why my code was not working... well I'll probably get to it when I am finished with the DAX course by Marco Russo and Alberto Ferrari! Give me a few months though - my brain is limited 😂
Thanks again :-0)