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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Greetings everyone,
I require some help with DAX. I am currently displaying the Year, Week, and Date in a Matrix Table, allowing for drill-down functionality. I am in need of writing a calculation for a Measure that accumulates values and resets every week. It's important to note that my week starts on Monday. Below is the measure I have written for the current year. In the second column, I need a calculation that represents the same value for the prior year. I would greatly appreciate any assistance or guidance provided. Thank you in advance.
Thank you guys, much appreciated.
The meaning of wtd is roughly as follows, please refer to it.
```
VAR DATE_END_AC =
LASTDATE ( '01_Calendar'[dates] )
VAR N_W =
WEEKDAY ( DATE_END_AC, 3 ) // Monday:0,Sunday:6
VAR DATE_START_AC =
DATEADD ( DATE_END_AC, - N_W, DAY )
VAR DATE_TABLE_AC =
DATESBETWEEN ( '01_Calendar'[dates], DATE_START_AC, DATE_END_AC )
VAR WTD0 =
CALCULATE ( SELECTEDMEASURE (), DATE_TABLE_AC )
```
There are more time dimensions, see the picture below.
https://jiaopengzi.com/2653.html
Is there an English version of this?
@batman , have column year, week, and weekday. try like
WTD LY = CALCULATE(sum(Tab1[Dollars]), FILTER(ALL('Calendar'),'Calendar'[Year]=max('Calendar'[Year]) -1 && 'Calendar'[Week]=max('Calendar'[Week]) && 'Calendar'[Weekday] <=max('Calendar'[Weekday])))
@amitchandak - Thank you for providing feedback, I was able to make it work with a similar formula
However once I roll it up to yearly level it just take the last number of the last week. Have you ran into this challange before?