Forum Discussion
Time Intelligence - Comparing Day of Week
- 9 years ago
Hello Anonymous and TomMartens!
Thanks for your contributions, it helped me a lot.
I used both of your ideas to combine it with my own. Using the Index, I could create the comparisons within a certain date range.
For Easther though, I still need to create the date alignment differently, since it's a fixed date which I need to compare to my previous Easter (we have a 45 day calendar for this campaign), that's where a Dim_Calendar_Campaign helped me out. There I can fix the dates I want to compare (2017-04-16 x 2016-03-27), using the Index to indicate whether the date is in the actual year or in the previous year.
Hi all :0)
I have let go the 'week day index' and simply use the dateadd function for the closest day (same 'day of week') :
Actual_364days earlier = CALCULATE([Actual], DATEADD('Calendar'[Date], -364, DAY))
I am a bit in doubt on this one as it looks so simple! Please let me know if I am wrong. Thanks.
Rebecca
Hi rosre075!
I might be mistaken, but leap years should be a problem with this formula.
Check out if the result works when you have a leap year.
- rosre0758 years agoFrequent Visitor
MrCoyado Thanks for your feedback. Since my purpose is to compare say the current Monday vs the Monday of the same period last year, I think this dateadd - 364day formula should be fine.
By the way, I found that the dayweek index suggested earlier is really handy and I have used it as the x Axis variable in the visual for this LY measure vs current value.
Thank all for your valuable advices :)
Rebecca