Forum Discussion
MTD Running Total Sales
- 8 years ago
Correct formula
Prev MTD Running Total Sales =
VAR CurrentDayNumber =
MIN ( MAX ( YTDInfos[CurrentDayNumber] ); MAX ( 'Calendar'[DayNumber] ) )
RETURN
IF (
[Prev MTD Sales] <> BLANK ();
CALCULATE (
[Total Sales];
FILTER (
ALL ( 'Calendar' );
AND ( 'Calendar'[MonthOffset] = -12; 'Calendar'[DayNumber] <= CurrentDayNumber )
)
)
)
The expected behavior is actually the following...
Sorry for the inconvenience.
Hi Anonymous,
Could you share a sample pbix file which can reproduce the issue, so that we can do some tests on it and better assist on this issue? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading. :smileyhappy:
Regards
- Anonymous8 years agoNot applicable
- popov8 years agoResolver III
Hello!
Try this formulas:MTD Running Total Sales =
IF (
[MTD Sales] <> BLANK ();
CALCULATE (
[Total Sales];
FILTER (
ALL ( 'Calendar' );
'Calendar'[MonthOffset] = 0
&& 'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
)Prev MTD Running Total Sales =
VAR CurrentDayNumber =
MAX ( YTDInfos[CurrentDayNumber] )
RETURN
IF (
[Prev MTD Sales] <> BLANK ();
CALCULATE (
[Total Sales];
FILTER (
ALL ( 'Calendar' );
AND ( 'Calendar'[MonthOffset] = -12; 'Calendar'[DayNumber] <= CurrentDayNumber )
)
)
)- popov8 years agoResolver III
Sorry, Prev MTD Running Total Sales is not correct. I will post correct formula later