Advanced last year comparison for a tour operator

perell

New Member
Joined
Feb 25, 2016
Messages
1
Hi

With my travel search dataset I've managed to create a last year comparison of searches over a given period of time. Ie. "Search Week this year" vs "Search Same week last year". Theese metrics will include searches of all available departure periods in a date format, ie. "2016-07-01".

What I would like do is to filter on the same departure month last year. If I use filter or slicer on the departure month "2016-07" there is no data from last year since the same departure month last year was "2015-07".

I've createted a calculated metric "months until departure" but I havent figured out how to translate this metric back to a month format like "2016-07" like in the table below.

[TABLE="width: 600"]
<tbody>[TR]
[TD][/TD]
[TD]Departure month: 2016-07[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Week[/TD]
[TD]Search TY[/TD]
[TD]Search LY (2015-07)[/TD]
[/TR]
[TR]
[TD]2016-05[/TD]
[TD]2500[/TD]
[TD]1900[/TD]
[/TR]
[TR]
[TD]2016-04[/TD]
[TD]2000[/TD]
[TD]1800[/TD]
[/TR]
</tbody>[/TABLE]

Just to clarify the problem with another example, how would you compare sale of iphone 6 (when relased) to iphone 5 at an earlier period of time where you dont just compare sale of all models of iphone?

Any idea how to approach this sort of comparison where the "product" differs from year to year?

Thank you
Per
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
This is a common requirement and easily handled in DAX. But there are layers and layers of learning and complexity to understand it. I can't teach you everything here (although you can buy my book - see the signature below). The basic principle is that you set up a calendar table in your data model. Read about calendars here Power Pivot Calendar Tables -

Then depending if you use a standard calendar or not, you can use an inbuilt function like this

Sales Last Year :=calculate(sum(sales[amount]),sameperiodlastyear(calendar[date]))

the above formula performs a time shift for you provided you follow the calendar rules in the link I provided.

If if you don't have a standard calendar, you need a more complex formula using filter (typically) to do the calculation.
 
Upvote 0

Forum statistics

Threads
1,224,154
Messages
6,176,731
Members
452,740
Latest member
MrCY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top