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
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
Employee
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
Employee
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
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.