cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
travbum
Advocate I
Advocate I

Progressively sum values for periods of time

I've got a table with:

Date  -- Amount -- Weeks Ago

10/24 -- 5 -- 0

10/23 -- 2 -- 0

10/22 -- 1 -- 1

...

10/14 -- 3 -- 2

Where Date has one entry per day, Amount, is a random value from 0 to 5, and Weeks Ago is the difference between Today() and the Date in weeks of the year. I want to output a graph that has the last 7 weeks while progressively adding the amounts together. Using the data above,

 

Week 0 = (5 + 2 + 1 + ... + 2)

Week 1 = (1 + ... + 2)

Week 2 = 2

 

Here is my first attempt at doing this. Am I anywhere close? Do I even have the right approach?

 

Sum Each Weeks Ago = SUMX( CALCULATETABLE('Sheet1'[Amount],
'Sheet1'[Weeks Ago] = 0,
'Sheet1'[Weeks Ago] = 1),

'Sheet1'[Weeks Ago] = 2),
'Sheet1'[Amount])

1 REPLY 1
Anonymous
Not applicable

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors