Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I'm trying to compare weekends this year with weekends last year.
The results i'm getting are that the last year is looking at the day not if it was saturday.
It should be lloking for the 01/05/2019 and compare with 01/06/2018 that was also a saturday.
Another thing is that, i want to my weekend be a friday and saturday and not a saturday and sunday, is that possible?
Thanks
Solved! Go to Solution.
you could do something like this
LastYearSameWeekDay = VAR __WeekNr = MAX('Calendar'[Week]) VAR __WeekDay = MAX('Calendar'[WeekDay]) VAR __Year = YEAR(MAX('Calendar'[Date])) RETURN CALCULATE(MAX('Calendar'[Date]), ALL('Calendar'),YEAR('Calendar'[Date])=__Year-1, 'Calendar'[Week]=__WeekNr, 'Calendar'[WeekDay]=__WeekDay)
it gives the date of the same day in the same week of previous year
it seems you need your own calendar table with a custom weekend indicator, and week number
this way you can have custom weekends and compare the weekends with the same index across years (e.g. week 10 of 2018 with week 10 of 2017)
I already have the week number and the weekend/weekdays in my calendar.
How do i compare the same saturday this year with the saturday last year?
Thanks
you could do something like this
LastYearSameWeekDay = VAR __WeekNr = MAX('Calendar'[Week]) VAR __WeekDay = MAX('Calendar'[WeekDay]) VAR __Year = YEAR(MAX('Calendar'[Date])) RETURN CALCULATE(MAX('Calendar'[Date]), ALL('Calendar'),YEAR('Calendar'[Date])=__Year-1, 'Calendar'[Week]=__WeekNr, 'Calendar'[WeekDay]=__WeekDay)
it gives the date of the same day in the same week of previous year
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |