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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
bombom
Helper I
Helper I

Power BI merge one column from one table to another

Hello!

 

I have two tables. They are joined together by TicketId column already.

 

Table 1.

 

TicketIdStartTimeOfLoadingEndTimeOfLoading
13358015.11.2022 12:16:5915.11.2022 12:25:37

 

Table 2.

 

CreatedAtTicketIdStepResult
14.11.2022 13:02:561335802Successfull
14.11.2022 13:05:151335804Successfull
14.11.2022 13:05:291335808Error
14.11.2022 13:11:231335802Successfull
14.11.2022 13:13:381335804Successfull
14.11.2022 13:13:521335808Error
14.11.2022 13:24:031335802Successfull
14.11.2022 13:26:211335804Successfull
14.11.2022 13:26:351335808Error
15.11.2022 12:16:581335802Successfull
15.11.2022 12:19:281335804Successfull
15.11.2022 12:25:361335805Successfull
15.11.2022 12:25:371335806Successfull
15.11.2022 12:25:371335807Successfull

 

StartTimeOfLoading column from Table 1 is the date from Table 2 with the Step = 2 and maximum date from the CreatedAt column. The same for EndTimeOfLoading column, but it's Step = 7.

 

I need to merge Steps 4, 5, 6 with max date condition on column from Table 2 to Table 1.

 

TicketIdStartTimeOfLoadingEndTimeOfLoading456
13358015.11.2022 12:16:5915.11.2022 12:25:3715.11.2022 12:19:2815.11.2022 12:25:3615.11.2022 12:25:37
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @bombom ,

 

Here are the steps you can follow:

1. Create calculated column.

4 =
MAXX(FILTER(ALL(Table2),
'Table2'[Step]=4&&'Table2'[TicketId]=EARLIER('Table1'[TicketId])),[CreatedAt])
5 =
MAXX(FILTER(ALL(Table2),
'Table2'[Step]=5&&'Table2'[TicketId]=EARLIER('Table1'[TicketId])),[CreatedAt])
6 =
MAXX(FILTER(ALL(Table2),
'Table2'[Step]=6&&'Table2'[TicketId]=EARLIER('Table1'[TicketId])),[CreatedAt])

2. Result:

vyangliumsft_0-1670290532538.png

 

Best Regards,

Liu Yang

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
Anonymous
Not applicable

Hi  @bombom ,

 

Here are the steps you can follow:

1. Create calculated column.

4 =
MAXX(FILTER(ALL(Table2),
'Table2'[Step]=4&&'Table2'[TicketId]=EARLIER('Table1'[TicketId])),[CreatedAt])
5 =
MAXX(FILTER(ALL(Table2),
'Table2'[Step]=5&&'Table2'[TicketId]=EARLIER('Table1'[TicketId])),[CreatedAt])
6 =
MAXX(FILTER(ALL(Table2),
'Table2'[Step]=6&&'Table2'[TicketId]=EARLIER('Table1'[TicketId])),[CreatedAt])

2. Result:

vyangliumsft_0-1670290532538.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors