Forum Discussion

wiktorius1984's avatar
wiktorius1984
Regular Visitor
6 years ago
Solved

Add Sum all the previous elements to a date

 

Hello, I would like the sum of hours for a month with previous months. 

my table looks like this

 

 

 

 

 

 

 

 

 

I would like to get something like this

 

 

 

 

 

 

 

Sum H and previous H =
CALCULATE(
Sum(Table[h],
FILTER(All(Table[Date]), Table[Date] <= MAX(Table[Date])
)

I tried this solution but it doesn't work

  • Anonymous's avatar
    Anonymous
    6 years ago

    wiktorius1984 

    _hours = CALCULATE(SUM('Table'[h]),ALLEXCEPT('Table','Table'[Month]))
    
    Comm_Hours = CALCULATE(SUM('Table'[h]),FILTER(ALL('Table'[Month]),'Table'[Month]<=MAX('Table'[Month])))

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    wiktorius1984 

    _hours = CALCULATE(SUM('Table'[h]),ALLEXCEPT('Table','Table'[Month]))
    
    Comm_Hours = CALCULATE(SUM('Table'[h]),FILTER(ALL('Table'[Month]),'Table'[Month]<=MAX('Table'[Month])))