Forum Discussion
Anonymous
4 years agoNot applicable
MTD FOR PREVIOUS PERIOD
I would like to be able to compare my MTD sales with any previous month for the same date range. Currently, I can only see MTD sales for the current month. When a previous month is chosen, the Total ...
- 4 years ago
Hi @ganenthra94
Here is the formula modified for your case. You need also to use the month name in the visual instead of the year (from the pevious date table). However this won't work with my samp[el file as it's data has only monthly ganularity. So please try with your data.
MTD = VAR NumOfMonths = -2 VAR ReferenceDate = MAX ( 'Date'[Date] ) VAR PreviousDates = FILTER ( DATESINPERIOD ( 'PreviousDate'[Date], ReferenceDate, NumOfMonths, MONTH ), DAY ( 'PreviousDate'[Date] ) <= DAY ( ReferenceDate ) ) VAR Result = CALCULATE ( SUM ( 'Sales'[Salesl] ), REMOVEFILTERS ( 'Date' ), KEEPFILTERS ( PreviousDates ), USERELATIONSHIP ( 'PreviousDate'[Date], 'Date'[Date] ) ) RETURN Result
HenriqueReis
Resolver I
4 years agoHi, how are you?
You should create a measure with this formula to see the before value you want:
Then, put the columns on a table visual and you gonna have this:
Notice I created the slicer visual too.
So, filter the visual according your preference and remove the column "VALUE" if you want:
I hope it helps you.
REGARDS!
Anonymous
4 years agoNot applicable
Unfortunately it has not. But thanks anyways.