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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Uzi2019
Super User
Super User

Incorrect Prev week value

Hi Community,

I need to calculate prev week spend which I tried from my end but at the measure total getting wrong result. Attaching sample data and screen shot below:

SpendDate
1201-Jan-2023
1302-Jan-2023
1503-Jan-2023
1204-Jan-2023
1105-Jan-2023
906-Jan-2023
567-Jan-2023
588-Jan-2023
369-Jan-2023
9010-Jan-2023

 

MicrosoftTeams-image (5).png

 

 

 

Prev Week Spend = 
VAR MaxWeek = MAX('Calendar'[WeekNo.])-1
VAR PrevWeek =  CALCULATE(SUM('Table'[Spend]),
                            FILTER(ALLSELECTED ('Calendar'),'Calendar'[WeekNo.]=MaxWeek
                            )
                         )

 

RETURN PrevWeek

 

Can anyone please help me out? It's quite urgent.
I would really appreciate your help

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
1 ACCEPTED SOLUTION
serpiva64
Solution Sage
Solution Sage

Hi,

try  a measure like this

Measure = CALCULATE(sum('Table (2)'[Spend]), OFFSET(-1,ALLSELECTED('Invoked Function'[ISOWeekID])))

serpiva64_0-1675943067451.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

View solution in original post

2 REPLIES 2
serpiva64
Solution Sage
Solution Sage

Hi,

try  a measure like this

Measure = CALCULATE(sum('Table (2)'[Spend]), OFFSET(-1,ALLSELECTED('Invoked Function'[ISOWeekID])))

serpiva64_0-1675943067451.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

@serpiva64 Thanks a bunch buddy. It's now working as per your given measure.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.