Forum Discussion

Applicable88's avatar
Applicable88
Impactful Individual
4 years ago
Solved

Running Total without Max(Date)

Hello,

 

I did try something out with the running total. Normally that is the standard running total for one sales and one date column from a mastercalendar:

Measure =
calculate(sum(Sales[Sales]),
Filter(
ALL('Calendar'[Date]),
'Calendar'[Date]<= MAX('Calendar'[Date])
))
 
My question is why 'Calendar'[Date] needs to be aggregated with Max function? 
 
Measure 1=
calculate(sum(Sales[Sales]),
Filter(
ALL('Calendar'[Date]),
'Calendar'[Date]<=('Calendar'[Date])
))
 
For example if the computing of the row 31-01.2021 happens, shouldnt't that happen in the background: 
'Calendar'[31-01.2021]<=('Calendar'[31-01.2021])
 
Shouldn't here be all the dates smaller or equal 31-01-2021 be included?

Instead for Measure 1 I always get only the total sum in every row. 

 

Thank you very much in advance.

Best regards. 

  • Applicable88 , Please find if the split can help

     

    Filter(
    ALL('Calendar'[Date]), -- Conside all dates in the calendar
    'Calendar'[Date] // column to be compared
    <=max('Calendar'[Date]) // This is current row context -- max of that row is the value of that row.
    ))
     
    So all dates below the date in context(rows) will be selected

1 Reply

  • Applicable88 , Please find if the split can help

     

    Filter(
    ALL('Calendar'[Date]), -- Conside all dates in the calendar
    'Calendar'[Date] // column to be compared
    <=max('Calendar'[Date]) // This is current row context -- max of that row is the value of that row.
    ))
     
    So all dates below the date in context(rows) will be selected