I have a table in Power BI with a measure calculating a rate for each week of the year using DAX Divide, I need to display the prior years result for the same week LY on the same row as a comparison column. I have the previous Year/Week as a data field to refer to. Example of the table below:
I've tried using the Filter function but to no avail as the Earlier function appears to not be available in DAX. I could add another two columns to then divide and essentially create the result from scratch for each column by offsetting the filter in the Calculate(Sum()) functions but I'm trying to avoid excessive calculation.
Year/Week Previous Year/Week Measure Previous Year Measure
2019 W10 2018 W10 3.3 3.1
2019 W09 2018 W09 3.3 3.1
…. … … …
…. … … …
2018 W10 2017 W10 3.1 2.9
2018 W09 2017 W09 3.1 2.9
… … … …