Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Date of Sequential Event

I am trying to create a calculated column that pulls the date of a sequential event in a series of events. The data I'm working with has account numbers, date of event, and event type. The type of events contains selections such as D1 and F1. D1 events precede all F1 events (e.g. customer starts at D1 event and ends with the corresponding F1 event).

 

For simplicity, this is what the table looks like:

 

 

Capture.JPG

These are the results I'm looking to get:

 

Capture1.JPG

 

I'm struggling to wrap my brain around how to get to this result. I'd assume that I would have to create some sort of index based on account number and event type and then reference the next number in the index for the event to get the date. Any help would be greatly appreciated. Thank you!

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Create a calculate column using DAX below:

Date of Sequential Event = IF('Table'[Event Type] = "D1", CALCULATE(MIN('Table'[Date of Svc]), FILTER('Table', 'Table'[Acct Nbr] = EARLIER('Table'[Acct Nbr]) && 'Table'[Event Type] = "F1")), BLANK())

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Create a calculate column using DAX below:

Date of Sequential Event = IF('Table'[Event Type] = "D1", CALCULATE(MIN('Table'[Date of Svc]), FILTER('Table', 'Table'[Acct Nbr] = EARLIER('Table'[Acct Nbr]) && 'Table'[Event Type] = "F1")), BLANK())

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.