I have a date table I am importing into a PowerPivot workbook. This data table contains a column entitled, 'date' which has a date for every day from 2000 to 2020. It has other basic columns like month name, month number, year, day, business day flag, etc.
I would like to create a measure which looks @ another measure called 'LastDate' (this identifies the last.max date in my data set) and then sets the measure to one of 5 values:
For example if the LastDate was equal to 3/13/13:
The part I am struggling with are the months that involve a year change.
Thanks in advance
I would like to create a measure which looks @ another measure called 'LastDate' (this identifies the last.max date in my data set) and then sets the measure to one of 5 values:
- Current Month
- Current Month -1 (aka Previous Month)
- Current Month -2
- Current Month -3
- Current Month -4+ (the rest)
For example if the LastDate was equal to 3/13/13:
- all dates in my date table where the Month is March and the Year is 2013 would have this new measure be equal to 'Current Month'
- all dates in my date table where the Month is Feb and the Year is 2013 would have this new measure be equal to 'Current Month -1'
- all dates in my date table where the Month is Jan and the Year is 2013 would have this new measure be equal to 'Current Month -2'
- all dates in my date table where the Month is Dec and the Year is 2012 would have this new measure be equal to 'Current Month -3'
- all dates in my date table where the date is earlier than Dec 2012 would have this new measure be equal to 'Current Month -4+'
The part I am struggling with are the months that involve a year change.
Thanks in advance