Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

YOY by Weekending date

Hi,

 

I am struggling to figure out how to create a YOY based off weekending date. I 3 tables 2018 revenue, 2019 revenue, and a dates table. I have calculated the weekending dates in my dates table and they correspond with the W/E dates in both of my revenue tables. 

 

My revenue tables consist of 

 

Par year | Region | Weekend date | Week Number | Revenue

 

My issue is that the weekending dates are different betweeen the two years I am trying to compare (18/19). I am looking for advice on how to equalize the dates so I can get a true year over year by weekending date. 

 

Any help is greatly appreciated. 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    If you have a "week of year" number in your dates table, you could do something like this:

    Revenue YoY = 
    var __WeekOfYear = MAX('Date'[WeekOfYear])
    var __ThisYearRevenue = CALCULATE(SUM('2019 Revenue'[Revenue])
    var __LastYearRevenue = CALCULATE(SUM('2018 Revenue'[Revenue])
    return __ThisYearRevenue - __LastYearRevenue 

    Hope this helps,

    Nathan