Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
Hi,
try a measure like this
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!
Hi,
try a measure like this
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 33 | |
| 29 | |
| 27 |
| User | Count |
|---|---|
| 134 | |
| 104 | |
| 63 | |
| 60 | |
| 55 |