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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Subtract previous aggregated week value

Hi there, 

 

I am trying to find a measure which calculates the aggregated quantity by week and subtracts it from the overall value.

 

My template is this Excel chart, it basically takes the overall quantity and subtracts the 'Note1 submissions' each given week from the previous week result (note: there are gap weeks with no values)

PBI_w_0-1595839399215.png

 

The column 'Bericht[Geplante Note 1Jahr]' values are weekly Dates in the Format dd.mm.yyyy, therefore there are multiple dates starting at the same Monday of a week.

 

I tried using this measure but returns blank

 

Overdue PPAPs = 
CALCULATE(COUNT(Bericht[Geplante Note 1Jahr]), 
          FILTER(Bericht, Bericht[Note1 Rank] = MAX(Bericht[Note1 Rank]) -1 ))

 

 

Is there a way to rebuild the chart above in PowerBI?

 

3 REPLIES 3
amitchandak
Super User
Super User

Anonymous
Not applicable

Hi @amitchandak ,

tried several approaches with your given links and blog posts but the only thing I get is nothing/blank.

Your formulas just simply sum up the values within one week and print them to the start date (WoW). But this is not what I am looking for, because I don't have values on Tuesday, etc, just on Mondays for the entire week. 

 

Therefore, I am rather looking for a formula which takes each week's WTD (in my case Bericht[Geplante Note1 Date], in picture 'Note 1 submissons')  and subtracts all previous WTDs including the current WTD from the overall value for each given week, as it can be seen in the screenshot bellow.

PBI_w_1-1596016455691.png

 

I do get the overall value minus the current WTD, but not the sum of all previous WTDs for each week (green bars in chart). Do you know a way to get this? 

Hi @Anonymous 

 

Not sure what your data looks like but you can try something like this:

cumulative value =
VAR _date =
    CALCULATE ( MAX ( table[date] ) )
RETURN
    CALCULATE (
        SUM ( table[value] ),
        FILTER ( ALL ( table ), table[date] <= _date )
    )

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.