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
Good morning,
I am asking you about a DAX measurement.
Indeed, I would like to compare the Y-1 value for the same NumDayWeek from the previous year.
In order to make a WTD
I have a date table
Can you help me ?
Solved! Go to Solution.
Hi, @DGTL
You can try the following methods.
Measure:
Value Y = CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE('Table'[Week])&&[NumDayWeek]=SELECTEDVALUE('Table'[NumDayWeek])&&[Year]=YEAR(TODAY())))Value Y-1 = CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE('Table'[Week])&&[NumDayWeek]=SELECTEDVALUE('Table'[NumDayWeek])&&[Year]=YEAR(TODAY())-1))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @DGTL
You can try the following methods.
Measure:
Value Y = CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE('Table'[Week])&&[NumDayWeek]=SELECTEDVALUE('Table'[NumDayWeek])&&[Year]=YEAR(TODAY())))Value Y-1 = CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),[Week]=SELECTEDVALUE('Table'[Week])&&[NumDayWeek]=SELECTEDVALUE('Table'[NumDayWeek])&&[Year]=YEAR(TODAY())-1))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Value Y: =
SUM( Data[Value] )Value Y-1: =
VAR _lastyear =
MAX ( Data[Year] ) - 1
VAR _samenumdayweek =
MAX ( Data[NumDayWeek] )
RETURN
CALCULATE (
SUM ( Data[Value] ),
Data[Year] = _lastyear
&& Data[NumDayWeek] = _samenumdayweek
)
Good morning,
Thank you for your reply,
But I would have to compare day 5 of week 2 of the year 2022
with day 5 of week 2, of the year 2023
Day 5 is not necessarily the same day. It's the fifth day of week 2.
You see ?
thanks again 🙂
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |