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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tgjones43
Helper IV
Helper IV

Conditional merge of two tables

Hi all

 

I have 2 tables that I would like to merge into 1 but I can't figure out how to do it. The 2 tables below show a simplified snippet of data. Table 1 has values for several parameters (not shown in table) collected every 15 minutes. Table 2 has extra values collected at a random time. I have manually added a column to table 1 [Additional Data] to give a Y at the 15 minute interval that most closely matches the time when that extra sample was collected. I would then like the measurement columns from Table 2 added to the end of Table 1, as shown in the final table.

 

Is there a way to do this in Power Query? Thank you!

 

Table 1

 

DateTimeAdditional Data
01/01/202200:00 
01/01/202200:15 
01/01/202200:30Y
01/01/202200:45 

 

Table 2

 

DateTimeMeasurement 1Measurement 2Measurement 3
01/01/202200:34123

 

Desired result

 

DateTimeAdditional DataMeasurement 1Measurement 2Measurement 3
01/01/202200:00    
01/01/202200:15    
01/01/202200:30Y123
01/01/202200:45    
1 REPLY 1
BA_Pete
Super User
Super User

Hi @tgjones43 ,

 

If you repeat the logic that you used to put the "Y" in Table1, but kind of in reverse, you can create a new column in Table2 that converts the actual read time to the nearest quarter hour.

From here, you can just merge on Table1[Date]&[Time] = Table2[Date]&[AdjustedTime]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.