Hello,
I am searching a solution to have the SalesLY for same periode as today.
I explain:
the Context is the FY18 (start in 1 july 2018 to 30june 2019)
the last sales date in the database is 28 september 2018
i would like to compare the sales between 1 july 2018 to 28 september 2018 with the SalesLY for the same periode.
Now I compare Sales for FY18 (3month) with FY17(12month)
I didn’t find how can i put a FILTER.
I have faced a similar scenario and this is the measure I used to resolve that issue:
Sales LY = // Sales Prior Period including only the same range of days in the YOY comparison.
VAR LastDaySelection =
LASTNONBLANK ( 'DATE'[Date], [Net Sales])
VAR CurrentRange =
DATESBETWEEN ( 'DATE'[Date], MIN ( 'DATE'[Date] ), LastDaySelection )
VAR PreviousRange =
SAMEPERIODLASTYEAR ( CurrentRange )
RETURN
IF (
LastDaySelection >= MIN ( 'DATE'[Date] ),
CALCULATE ( [Net Sales], PreviousRange )
)