Hi,
I am trying to use the Earlier function to do some complex date compares. Basically I have a series of events with Begin and End dates. They go in sequences, so the events are marked as either an EarlierEvent or LaterEvent (I had to reverse the EarlierEvent operators to meet the syntax). What I want to do is for each LaterEvent, find the most recent earlierEvent, but only if it ended with 30 days of the later event.
Here’s my formula. It always returns blanks. Any ideas?
- Pete
=if([LaterEvent]="Y",MAXX(
FILTER('FactTable',("Y"=Earlier(FactTable[EarlierEvent]) && 'FactTable'[FactKey] = EARLIER('FactTable'[FactKey]) && 'FactTable'[BeginDate] >= (EARLIER('FactTable'[EndDate])) && 'FactTable'[BeginDate] <= (EARLIER('FactTable'[EndDate])+30) ))
,'FactTable'[EndDate]
),BLANK())
I am trying to use the Earlier function to do some complex date compares. Basically I have a series of events with Begin and End dates. They go in sequences, so the events are marked as either an EarlierEvent or LaterEvent (I had to reverse the EarlierEvent operators to meet the syntax). What I want to do is for each LaterEvent, find the most recent earlierEvent, but only if it ended with 30 days of the later event.
Here’s my formula. It always returns blanks. Any ideas?
- Pete
=if([LaterEvent]="Y",MAXX(
FILTER('FactTable',("Y"=Earlier(FactTable[EarlierEvent]) && 'FactTable'[FactKey] = EARLIER('FactTable'[FactKey]) && 'FactTable'[BeginDate] >= (EARLIER('FactTable'[EndDate])) && 'FactTable'[BeginDate] <= (EARLIER('FactTable'[EndDate])+30) ))
,'FactTable'[EndDate]
),BLANK())