Forum Discussion
Josh_Ped
3 years agoNew Member
Balance sheet graph stop at current month
Hi Guys, I have a graph of total value of stock, and i cannot get it to stop at the current fiscal_month. If have filters on the page for year and month. The balance is made of periods CF...
sevenhills
Super User
3 years agoSince you did NOT attach the model, it is tough to get the eaxact DAX.
I kind of wrote the psuedo code, to cut off at the end of the today's month. Hope this helps!
Stock on Hand =
var _EO_MONTH_today = EOMONTH ( TODAY(), 0)
var _sel_date = EOMONTH ( DATE(SELECTEDVALUE(Years[Year]), Selectedvalue(Months[Fiscal Month]), 1))
var _cut_off_date = IF (_EO_MONTH_today >= _sel_date, _EO_MONTH_today, _sel_date)
RETURN
CALCULATE(
sum(TGLBalsheet[balance]),
TGLBalsheet[accountid] IN {82,260,232,118},
-- Optional: I would recommend to use cut off date here. It is Okay to use months and year fitler too.
all(months),
Months[Fiscal Month] <= MONTH(_cut_off_date),
Years[Year] = YEAR(_cut_off_date)
)