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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors