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
Tech122
Frequent Visitor

Previous Week Result use as a base of next Week start

Hi All, 

Need some help with this, please.

So, Every week there is an End calculation, and the End calculation needs to be the base of next week's calculation.

i.e on 1/1/2323 the End = 195, And the End 195 needs to use as the Base of next week 8/1/2323, and so on.

 

I have tried to find out a solution on the entire web but didn't find anything. I'll really appreciate any input on this, please. 

Data.png

 

 Thanks

 

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your end result looks like, but I tried to create a table visualization and a measure like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1685256961120.png

 

 

Base measure: = 
VAR _startdate =
    CALCULATE ( MIN ( Data[Date] ), REMOVEFILTERS ( Data ) )
VAR _basestart =
    CALCULATE ( SUM ( Data[Base] ), Data[Date] = _startdate )
RETURN
    SWITCH (
        TRUE (),
        MAX ( Data[Date] ) = _startdate, _basestart,
        HASONEVALUE ( Data[Date] ),
            _basestart
                + CALCULATE (
                    SUMX ( Data, Data[Increase] + Data[Decrease] ),
                    WINDOW ( 1, ABS, -1, REL, ALL ( Data[Date] ), ORDERBY ( Data[Date], ASC ) )
                )
    )

 

End measure: =
IF (
    HASONEVALUE ( Data[Date] )
        && NOT ISBLANK ( SUMX ( Data, Data[Increase] + Data[Decrease] ) ),
    [Base measure:]
        + SUMX ( Data, Data[Increase] + Data[Decrease] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.