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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
KJ_YG
New Member

Combining/Merging columns with different data and quantity

Hello I am currently working on a project which requires me to combine 2 files. the examples of the 2 files are shown below. 

File 1 

PO trackerPR trackerdata
1234567811111A12
8765432122222A13
1111111133333A8
2222222244444A7
3333333355555A6
4444444422222B5
5555555522222R4
null88888Lnull
null22222Tnull

 

File 2 

Tracking POTracking PRvalue
6666666666666U55
7777777799999J11
1111111133333A8
2222222244444A7
3333333355555A6
4444444422222B5
5555555522222R4
8888888800000N32
   

 

The columns needs to be merged to end up with looking like this.

PO trackerTracking POPR trackerTracking PRdatavalue
12345678 11111A 12 
87654321 22222A 13 
111111111111111133333A33333A88
222222222222222244444A44444A77
333333333333333355555A55555A66
444444444444444422222B22222B55
555555555555555522222R22222R44
null 88888L null 
null 22222T null 
 66666666 66666U 55
 77777777 99999J 11
 88888888 00000N 32

 

1 ACCEPTED SOLUTION
bharath_v
Resolver I
Resolver I

hi @KJ_YG 

 

You need to manage the relationship between the primary keys in the table.

 

To do that, go to model view and add a new relationship like below:

bharath_v_0-1678423519641.png

 

Once you do that now you can add a matrix in the order you need to get the output. 

I simulated your scenario and got this:

bharath_v_1-1678423593077.png

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

3 REPLIES 3
bharath_v
Resolver I
Resolver I

It is possible to create 1:1 relationships. You can see it in my screenshot above I have created 1:1 with your sample data. 

 

Are you not able to change it? Then it could be that your data may be not have unique values in one/both of the tables.

bharath_v
Resolver I
Resolver I

hi @KJ_YG 

 

You need to manage the relationship between the primary keys in the table.

 

To do that, go to model view and add a new relationship like below:

bharath_v_0-1678423519641.png

 

Once you do that now you can add a matrix in the order you need to get the output. 

I simulated your scenario and got this:

bharath_v_1-1678423593077.png

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

 

Thany you so much for your help. However, it would be better if i were to create a 1 to 1 relationship between my PO tracker and tracking PO values. Why is it not possible to create a 1 to 1 relationship between them? 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.