## Desktop

Frequent Visitor
Posts: 12
Registered: ‎11-22-2017

# Sum of the last value regarding a relative date (dynamic) and for a specific period

[ Edited ]

Dear All,

I would like to follow the forecast update by getting the sum of the last value for each day

in the table below if I select (on my chart) the date of

1. 3rd of January I must have the sum value for

• January = A(6)  + B(5) =11
• February = Null =0

1. 8th of January I must have the sum value for

• January = A(6)  + B(5) =11
• February = A(8) + B(9) =17

 CUSTOMER DATE UPDATE PERIOD VALUE A 01/01/2018 2018.01 4 B 02/01/2018 2018.01 5 A 03/01/2018 2018.01 6 C 04/01/2018 2018.03 7 A 05/01/2018 2018.02 8 B 06/01/2018 2018.02 9

Novice

Community Support Team
Posts: 4,051
Registered: ‎07-09-2016

## Re: Sum of the last value regarding a relative date (dynamic) and for a specific period

You may add the following measure.

```Measure =
SUMX (
SUMMARIZE ( Table1, Table1[CUSTOMER] ),
CALCULATE (
SUMX ( TOPN ( 1, Table1, Table1[DATE UPDATE], DESC ), Table1[VALUE] )
)
)
```
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Frequent Visitor
Posts: 12
Registered: ‎11-22-2017

## Re: Sum of the last value regarding a relative date (dynamic) and for a specific period

Hello Sam,

Thanks, I tried but doesn't work,

Novice

Frequent Visitor
Posts: 12
Registered: ‎11-22-2017

## Re: Sum of the last value regarding a relative date (dynamic) and for a specific period

[ Edited ]

The graph should show me the last value udpate for a relative date in this case around 13-14K