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

Table Merge

Hi All,

I'm trying to merge two tables. Basically, I just want to fetch the Hours from Table B matching the Login ID and Date. I tried merging Table A and Table B, it creates duplcates. Any help is greately appreciated.

 

MacyMolly_0-1626391337196.png

 

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @MacyMolly 

Three columns Date/ Name and ID are all the key in Merge. If you only use one of them as the key in Merge, Power BI will show you all possible results when you expand the column from "Table B". So you will get duplicate results.

Use Ctrl + left click to choose multiple columns one by one as below.

1.png

Result is as below.

2.png

Best Regards,

Rico Zhou

 

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

6 REPLIES 6
v-rzhou-msft
Community Support
Community Support

Hi @MacyMolly 

Three columns Date/ Name and ID are all the key in Merge. If you only use one of them as the key in Merge, Power BI will show you all possible results when you expand the column from "Table B". So you will get duplicate results.

Use Ctrl + left click to choose multiple columns one by one as below.

1.png

Result is as below.

2.png

Best Regards,

Rico Zhou

 

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

 

johncolley
Solution Sage
Solution Sage

Hi @MacyMolly I think the issue is the many-to-many relationship on the join. Are you able to create a distinct user table for the join - or use a bridging table as explained in this example ?

Hi @johncolley , No Haven't tried doing it and i'm not source how to apply it with my datasets.

Here's a sample of my datasource.

datasource 

 

Hi @MacyMolly I've created a date bridge table in this pbix. From it you can use your agent, hours and data tables to build visuals. Hope this addresses what you need?

 

https://www.dropbox.com/s/9g1kpsz0eo0budw/Sample%20datasource%20with%20date%20bridge.pbix?dl=0 

johncolley
Solution Sage
Solution Sage

If you just click the table option it wont duplicate rows like it does when you expand the table. 

johncolley_0-1626392445938.png

Then you get desired result.

johncolley_1-1626392494185.png

 

Hi @johncolley ,

I have hundreds of agents so i can't just click the "Table" option.
This is what will happen when I expand the table. It creates duplicate rows.

 

MacyMolly_0-1626413366402.png

 

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.