Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
wiktorius1984
Regular Visitor

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

table2.png

 

 

 

 

 

 

 

 

 

I would like to get something like this

 

table.png

 

 

 

 

 

 

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

1 ACCEPTED SOLUTION
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])))

View solution in original post

2 REPLIES 2
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])))

Thank you very much, everything works beautifully

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.