Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How to create a date filter using date column

Hi 

 

I have created date as two dimensions and its working fine but am expecting to create that dimension as one column. 


Step 1:

Last6Month = VAR six =1.* (MasterTable[MaxDate]-MasterTable[6Month])

RETURN if(MAX(SiteMasterTable[Date]) - MasterTable[Date] <six,"6M","Older")

Similarly I have created that date filter for Last12Month also.
 
Here am creating these two columns into one column but its not working as expected,
 
 Step2:
 
MonthSlicer = VAR six =1.* (MasterTable[MaxDate]-MasterTable[6Month])
 VAR eighteen =1.* (MasterTable[MaxDate]-MasterTable[18Month])
RETURN   if(MAX(SiteMasterTable[Date]) - MasterTable[Date] <six,"6M",
                if(MAX(SiteMasterTable[Date]) - MasterTable[Date] <six,"12M","Older"))
 
Here MasterTable[MaxDate] --> it contains max date from date column
MasterTable[6Month] & MasterTable[18Month] --> it contains 6M & 18M  date.
 
Could you please suggest me how to acheive this into one column.
 
Regards,
Yuvaraj
 

3 Replies