Forum Discussion
Kolumam
Post Prodigy
8 years agoAssistance with Calculation
Hi All, As you can see from the pic that the size increases every month. How do I display the difference in size as well ? For example : For the month of Feb , instead...
Anonymous
8 years agoNot applicable
I wrote something like this for another post. Not the only way to do this, but it was the first way that came to mind:
SumHeadcount = VAR CurrentMonth LASTDATE('YourTable'[Date])
VAR LastMonthNum = if(Month(CurrentMonth) = 1, 12, MONTH(CurrentMonth) - 1)
VAR LastMonth = if(Month(CurrentMonth) = 1, DATE(YEAR(CurrentMonth]) - 1, LastMonthNum, 1), DATE(YEAR(Date]), LastMonthNum, 1))
RETURN
CALCULATE(
SUM('YourTable'[ValueField]),
ALL('YourTable')
'YourTable'[Date] >= LastMonth,
'YourTable'[Date] <= CurrentMonth
)EDIT: The code above doesnt do exactly your thing, but it might give you something to work from