Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
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 🙂
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |