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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.