Hi,
In a recent video like for like same period last year measures were created;
so if current year only has 6 month the total for prevous year should aslo just have those months
this was ;
DATESBTWN :=
VAR maxdate =
EOMONTH ( MAX ( Table1[Date] ), -12 )
VAR mindate =
EDATE ( MIN ( 'Calendar'[Date] ), -12 )
VAR period =
DATESBETWEEN ( 'Calendar'[Date], mindate, maxdate )
RETURN
IF (
NOT ( ISBLANK ( [TotalUnits] ) ),
CALCULATE ( [TotalUnits], period ),
BLANK ()
)
But I also tried the following which does give ( i think) the correct start and end dates but for the total I only get the last figure, I have highlighted this in the Pivot attached;
StartToEnd :=
VAR ddate =
MAX ( Table1[Date] )
VAR mindate =
DATE ( YEAR ( ddate ) - 1, MONTH ( ddate ), 1 )
VAR maxdate2 =
EOMONTH ( ddate, -12 )
VAR inbetween =
DATESBETWEEN ( 'Calendar'[Date], mindate, maxdate2 )
RETURN
IF ( ISBLANK ( [TotalUnits] ), BLANK (), CALCULATE ( [TotalUnits], inbetween ) )
Can someone see why I'm getting the wrong result, secondly is there a way apart form the 'IF' statement I've use to get ride of the unwanted figures
I have highlighted these in orange, can someone tell me how they are calculated;
Richard.
Richard.
Bookmarks