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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

increment sum value group by month and item type

hi,

 

I'm trying to incremental summing my table's column value by it's datetime and group.

so far, I have created this dax code for it:

CALCULATE(SUM('my_table'[value]),FILTER('my_table'[type]='my_table'[type]&&'my_table'[datetime]<=EARLIER('my_table'[datetime])))

this code are doing the incrimental summing, but it won't sum my value data for each group that i have.

community.PNG

 

do anyone have idea where did my code went wrong?

or maybe another way to get the result that I want.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

hi, 

 

fixed my code and got the result that I want.

 

this is my final code, in case there are someon who has the same problem 

column = CALCULATE(SUM('my_table'[value]),FILTER('my_table','my_table'[datetime]<=EARLIER('my_table'[datetime])&&'my_table'[type]=EARLIER(my_table[type])))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

hi, 

 

fixed my code and got the result that I want.

 

this is my final code, in case there are someon who has the same problem 

column = CALCULATE(SUM('my_table'[value]),FILTER('my_table','my_table'[datetime]<=EARLIER('my_table'[datetime])&&'my_table'[type]=EARLIER(my_table[type])))
jdbuchanan71
Super User
Super User

Hello @Anonymous 

Give this a try:

Running Total = 
VAR MaxDate = MAX ( MyTable[DateTime] )
RETURN 
CALCULATE (
    SUM ( MyTable[Value] ),
    ALL ( MyTable[DateTime] ),
    MyTable[DateTime] <= MaxDate
)

runningtotal.jpg

Anonymous
Not applicable

hi @jdbuchanan71 ,

 

thank you for the code.

tried it on my side, but sadly it's not incrementally sum my value but only showing the exact same data as my value collumn

 

typevaluedatetimeexpected_resultresult_from_my_coderesult_from_your_code
CR52019/04/01 0:005155
CR52019/05/01 0:0010305
CR52019/06/01 0:0015455
KR62019/04/01 0:006156
KR62019/05/01 0:0012306
KR62019/06/01 0:0018456
YR42019/04/01 0:004154
YR42019/05/01 0:008304
YR42019/06/01 0:0012454

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.