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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KatjafromHaj
Frequent Visitor

add data from previous row

Hi Community,

 

I have a list of incidents, with tow major events: Open & Reassignment. The enddate of each event is the respective startdate of the following major event. Between these major events, other "Sub events" happening.  In column " ID Open & Reassignment" I need the ID of the previous major event. 

 

I tried many approaches but nothing worked so far.

 

Incident IDID Open & ResassignmentActivityStart dateEnd dateIndex
I-00110Open03.03.2020 15:00:016.03.2020 16:00:001
I-0010Status Change03.03.2020 15:00:0003.03.2020 15:00:002
I-0010Assignment03.03.2020 15:00:0003.03.2020 15:00:003
I-0010Operator update08.03.2020 16:37:0016.03.2020 16:00:004
I-00111Reassignment16.03.2020 16:00:0025.03.2020  08:05:005
I-0010Status Change18.03.2020 07:10:0018.03.2020 07:10:006

 

Thanks a lot in Advance!

1 ACCEPTED SOLUTION

You will want to implement your entire logic in Power Query. There are many tutorials on how to reference other rows in your source data, like here https://www.myonlinetraininghub.com/referencing-next-row-power-query

View solution in original post

3 REPLIES 3
stevedep
Memorable Member
Memorable Member

Instead of dax you can make a copy of the table and join the 2 with start date = end dat and Id. Merge tables in power query.

Hi Steve,

 

column "End date" is a calculated column, so it is not available in power query.  The original query contais only the start date of each event.

I created 2 queries : 1. all events & 2. Open & Reassignment.

You will want to implement your entire logic in Power Query. There are many tutorials on how to reference other rows in your source data, like here https://www.myonlinetraininghub.com/referencing-next-row-power-query

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.