Forum Discussion
Forecast for running total
Hi, Shuuuu
make a seprate table of Month no from date table
newtable = all(date[month no])
and use it in a slicer and don't make relationship with your data model
make a new column in actual spent table
column =
var curr_month = selectedvalue(newtable[month no])
return
sumx(
filter(
CROSSJOIN(
values(date[month no]),
values(actual spent[actual forecast])
),
date[month no]<=curr_month
),
actual spent[actual forecast]
)
Hi Dangar332 its just showing one month total instead of increasing like image above for january
- Dangar3322 years agoResident Rockstar
- Shuuuu2 years agoFrequent Visitor
hi Dangar332, I change my solution. Right now it able to cumulative prefectly for january. But when select slicer february it only cumulative the february data. The concept is nearly correct. But I want the output of feb - march like below.
For example,
jan - only cumulative jan value
feb - jan + feb + then march until dec is cumulative using feb value
march - jan + feb + march + april until dec is cumulative using march value
same goes to when select other month slicer (slicer have jan until dec)
concept that I want when select february slicerright now in pbi, its appear like below
the formula i usedForecast Spent =VAR CurrentMonth = MONTH(MAX('Calendar'[Date]))VAR Cumulative =IF(CurrentMonth = 1, // Start cumulative from JanuaryCALCULATE (SUMX (FILTER (ALLSELECTED('Calendar'[MonthNo],'Calendar'[MonthShortName]),'Calendar'[MonthNo] <= MAX('Calendar'[MonthNo])),Summary[Actual Spent])),IF(CurrentMonth > 1, // Start cumulative from February onwardsCALCULATE (SUMX (FILTER (ALLSELECTED('Calendar'[MonthNo],'Calendar'[MonthShortName]),'Calendar'[MonthNo] <= MAX('Calendar'[MonthNo])),Summary[Actual Spent])),BLANK() // Return blank for other months))RETURNCumulative
my tables