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
siva3012
Helper II
Helper II

I need to Merge two tables?

 

Hi, I need to merge these two tables which contain Price and Qty. I have to merge using using Date and Time. Can anyone solve this as there exisits two Time columns  ?

 

QTY VS Price.jpg

 

 

 

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@siva3012

 

In this scenario, you can SUMMARIZE your QTY table group on Time_1 and Time_2 into two calculated tables, then UNION these two tables together and build relationship to Price table on Time column.

 

Or you can create a conditional LOOKUP column in Price table to get the QTY from QTY table:

 

Qty =
IF (
    LOOKUPVALUE ( QTY[QTY], QTY[Time1], Price[Time] ) = BLANK (),
    LOOKUPVALUE ( QTY[QTY], QTY[Time2], Price[Time] ),
    LOOKUPVALUE ( QTY[QTY], QTY[Time1], Price[Time] )
)

77.PNG

 

 

Regards,

View solution in original post

3 REPLIES 3
v-sihou-msft
Microsoft Employee
Microsoft Employee

@siva3012

 

In this scenario, you can SUMMARIZE your QTY table group on Time_1 and Time_2 into two calculated tables, then UNION these two tables together and build relationship to Price table on Time column.

 

Or you can create a conditional LOOKUP column in Price table to get the QTY from QTY table:

 

Qty =
IF (
    LOOKUPVALUE ( QTY[QTY], QTY[Time1], Price[Time] ) = BLANK (),
    LOOKUPVALUE ( QTY[QTY], QTY[Time2], Price[Time] ),
    LOOKUPVALUE ( QTY[QTY], QTY[Time1], Price[Time] )
)

77.PNG

 

 

Regards,

KarineLago
Advocate I
Advocate I

@siva3012you have to create an unique value. If your tables doesn't have this property, you can always create your own by concatenating the columns (at Query Editor with a calculated column) that is equal in both tables and then using them to merge.

 

From Brazil? Go to IntelExcel YT channel https://www.youtube.com/user/Intelxcel to learn Power BI.
cs_skit
Resolver IV
Resolver IV

create a calculated column combining the date and the time1 for both tables then merge on that created column

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.