Forum Discussion
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:
| Spend | Date |
| 120 | 1-Jan-2023 |
| 130 | 2-Jan-2023 |
| 150 | 3-Jan-2023 |
| 120 | 4-Jan-2023 |
| 110 | 5-Jan-2023 |
| 90 | 6-Jan-2023 |
| 56 | 7-Jan-2023 |
| 58 | 8-Jan-2023 |
| 36 | 9-Jan-2023 |
| 90 | 10-Jan-2023 |
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
Hi,
try a measure like this
Measure = CALCULATE(sum('Table (2)'[Spend]), OFFSET(-1,ALLSELECTED('Invoked Function'[ISOWeekID])))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!
2 Replies
- serpiva64Solution Sage
Hi,
try a measure like this
Measure = CALCULATE(sum('Table (2)'[Spend]), OFFSET(-1,ALLSELECTED('Invoked Function'[ISOWeekID])))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!