0

Compare dayweek to dayweek

Hi, 

I need a sample to compare day of week to last year day of week. 

Currently I have LY measure, that is used as parallelperiod, but it is not OK, because it goes one year back and compares date to date. But for example. I need to compare this monday to last year monday in the same range

In the attachment is sample. Empty space in C column is what I would like to get. 

Thanks

Borut

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Easiest would be to use ParallelPeriod with a Date hierarchy based  on weeks, rather than months, i.e. Year --> Week no. --> Date. If it is possible to have that added to your data model, that is the most straightforward approach, then your parallel period will automatically compare the same day of the week to the same week number when it goes back one year.

    If all you have is one Date hierarchy (or no date hierarchies) in months, it is more complicated. You could use .LAG(366) to find the same date -1 a year ago (ie the same day of the week), but you will also have to test if the year is a leap year and adjust the .LAG()  to .LAG(367). This is, of course, assuming your date dimension includes all dates of the year.

    Reply Like
  • Hi Ian, 

    Thanks for reply. I will check our clients date hierarchy and see which approach is more suitable for me...

    Reply Like
  • Hi Ian, 

    I have created measure that is working just fine. Not With LAG 367, but with LAG 364. I also created parallelperiod with weeks, rather than months. and moved not for 1 year, but for xx weeks back. 

    Now I have the issue with visual totals, because it is not showing for this calculated measure. Do you happened to know, what can be the cause of it?

    Thank you

    Borut

    Reply Like
  • Hi Borut,

    No, not sure what could be the issue there. you may like to check Solve Order of the calculated item and see if varying that helps.

    Ian

    Reply Like
login to reply
Like Follow
  • Status Answered
  • 2 wk agoLast active
  • 4Replies
  • 47Views
  • 2 Following