Compare to Previous Period, Dynamic


Been looking at all the articles on here and trying many different things.

Trying to achieve this

  • Compare to a previous period, primary use case is to Last Year (to date)
  • The comparison for each measure should be side by side e.g. whereas if you do table calculations they are all grouped together

First post, hoping y’all have a nice way to achieve the example in the image link above.

In terms of the closest I came:
Tried creating a this_year parameter where you select the ‘year’ you want to compare against. And then 2 dimensions for is_thisyear and is_lastyear which are based on the user input for the this_year, so if 2019 then is_ly = 2018.
Then had measures for Revenue_thisyear Revenue_lastyear Orders_thisyear Orders_lastyear with each having a ‘filter’ on the is_thisyear/lastyear dimension.
But that leads to sooo many measures, for every single measure you want to have comparisons for. And isn’t a simple solution for our users. You can’t use the regular date dimensions of 2019-01-01, you have to know to only use date dimensions that do not have ‘year’ in them e.g. Month Name and Day of Month.

Thank you!