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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have used these Dax formula to calculate Previous Week but results are incorrect, can someone please help me rectify this? Thanks in advance.
First Formula used populates column but values are incorrect.
Previous Week in Second Forumula shows blank Values
@ValtteriN Can you assist? I do not have lastWeek as a table to filter on, so I used calendar and here are my results.
Dax Formula:
Hi @Merle,
You can try to use the following formula to get the previous week amounts:
formula =
VAR currdate =
MAX ( Calendar[Date] )
VAR weekStart =
IF (
WEEKNUM ( currdate, 1 ) <> 1,
currdate - WEEKDAY ( currdate, 1 ) + 1,
DATE ( YEAR ( currdate ), 1, 1 )
)
RETURN
CALCULATE (
SUM ( Table[TOTAL_ACTIONS] ),
FILTER (
ALLSELECTED ( Table ),
YEAR ( [Date] )
= YEAR ( weekStart - 1 )
&& WEEKNUM ( [Date] , 1 )
= WEEKNUM ( weekStart - 1 , 1 )
)
)
Regards,
Xiaoxin Sheng
Hi Valtterin,
Thank you for your response. The results I am looking for is Actions for the last week to the current week values not the actual week num.
Hi,
Try using WEEKNUM e.g.
Proud to be a Super User!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
4 | |
3 |
User | Count |
---|---|
14 | |
13 | |
11 | |
10 | |
10 |