Forum Discussion
Running Total Removing Blanks
- 4 years ago
Hi,
It looks like it's worked. For my own benefit, could you explain why you did this calculation and the logic that is occuring in it.
Date till which actual sales are available =
CALCULATE(MAX(Sales[SalesDate]),FILTER(ALL('Date'[Date]),[Sales1]>0))
Sales1 = SUM(Sales[Sales])
And why does this not work in this scenario, why do you have to filter it by date and sales?
MAX(Sales[SalesDate])
The following calculation you provided for running total:
Running Total Measure =
IF(MAX('Date'[Date])>[Date till which actual sales are available], blank(),
calculate([Sales1],datesmtd('Date'[Date])))For this calculation, just wondering why you used MAX('Date'[Date]), wouldn't this just apply for the maximum date in the date table (i.e. 30 March 2022) being blank and not every date after the sales date.
Or am I misinterpreting the logic. Any explanation on all of this would help me going forward.
Thanks.
- Ashish_Mathur4 years ago
Super User
The first calculation is to determine the last date till which there is data in the actual sales table. Via this measure, I have applied a filter on where sales > 0 and then calculated the max date from the actual sales table. Max(Date[Date]) will return the date of the existing row in the matrix visual. So if the date in the matrix visual is > [Date till which actual sales are available] then show a blank, else perform the MTD calculation.
If my previous reply helped, please mark it as Answer.