Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to sum the dollar amount of the Previous Month based on the selected date(GLFileDate).
I set up a variable for PriorMonth
(vPriorMonth)- =month(addmonths(max(GLFileDate),-1))
Set an expression below, but it returns $0.00
=sum({$<GLFileDate=($(vPriorMonth))>}[Closing Balance USD])
I am able to get the Expression title to render the previous month, so I think the variables that I set up are functioning properly
='Previous Month:
$(vPriorMonth) $(vMaxDay), $(vPriorMonthYear)'
returns Previous Month: May 15, 2015 when 6/15/2015 is selected
Any suggestions?
Dan
Or you can set your variable definition as this:
vPriorMonth =Date(AddMonths(Max(GLFileDate),-1), 'sameDateFormatasGLFileDate')
and then use
=Sum({$<GLFileDate={"$(vPriorMonth)"}>}[Closing Balance USD])
HTH
Best,
Sunny
Hi, GLFileDate seems to be a date field and you are comparing date field to just a month. You probably would need to do something like this:
=Sum({$<GLFileDate={"=Month(GLFileDate) = $(vPriorMonth)'}>}[Closing Balance USD])
Or you can set your variable definition as this:
vPriorMonth =Date(AddMonths(Max(GLFileDate),-1), 'sameDateFormatasGLFileDate')
and then use
=Sum({$<GLFileDate={"$(vPriorMonth)"}>}[Closing Balance USD])
HTH
Best,
Sunny
Thank you Sunny- this worked!
Or you can set your variable definition as this:
vPriorMonth =Date(AddMonths(Max(GLFileDate),-1), 'sameDateFormatasGLFileDate')
and then use
=Sum({$<GLFileDate={"$(vPriorMonth)"}>}[Closing Balance USD])