cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ZoltanFut Frequent Visitor
Frequent Visitor

How to sum values from previous lines?

 

Hi guys,

 

I’ve a following problem:

 

There’s a table with the following columns:

Date

Value

2018.06.25

12

2018.06.26

12

2018.06.27

12

2018.06.28

4

2018.06.28

8

2018.06.29

1

2018.06.29

8

 

How can I add a column, that sums the values by the actual date in the row, like this?

 

Date

Value

SumValue

2018.06.25

12

12

2018.06.26

12

24

2018.06.27

12

36

2018.06.28

4

40

2018.06.28

8

48

2018.06.29

1

49

2018.06.29

8

57

 

Thanks for your suggestions in advance!

 

Zoltán

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: How to sum values from previous lines?

Hi @ZoltanFut

 

Try this for your new column. Note that this will yield the same result for all rows with the same date, since I see there are duplicates.

 

 

CumulativeSumValue =
CALCULATE (
    SUM ( Table1[Value] ),
    FILTER ( Table1, Table1[Date] <= EARLIER ( Table1[Date] ) )
)

 

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: How to sum values from previous lines?

Hi @ZoltanFut

 

Try this for your new column. Note that this will yield the same result for all rows with the same date, since I see there are duplicates.

 

 

CumulativeSumValue =
CALCULATE (
    SUM ( Table1[Value] ),
    FILTER ( Table1, Table1[Date] <= EARLIER ( Table1[Date] ) )
)

 

View solution in original post

ZoltanFut Frequent Visitor
Frequent Visitor

Re: How to sum values from previous lines?

Hi AlB,

 

thanks for the solution, and the idea, I can work toward on this  🙂

 

thanks

Zoltán

 

 

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)