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
vitexo87
Post Prodigy
Post Prodigy

Joining contents of two tables into one new table

I have the Table A:

Entidade_ID
LocOrgTrab_CD
Empresa_ID
Orgao_CD
Ano_CD
SiglaOrgaoF

 

Table B:
LocOrgTrab_ID
LocOrgTrab
LocOrgTrab_CD
LocOrgTrab_DS
LocOrgTrab_SL
Entidade_ID

 

As can be noted in both tables I have the LocOrgTrab_CD and Entidade_ID fields, and through them I need to somehow relate these two tables to setornar into one, in the end I wanted to have a table with the following fields:

 

Table C:

Entidade_ID
LocOrgTrab_CD
Empresa_ID
Orgao_CD
Ano_CD
SiglaOrgaoF
LocOrgTrab_ID
LocOrgTrab
LocOrgTrab_DS
LocOrgTrab_SL

 

I can do it without problem using the Add Query feature, however the table information with B table are not matching, for example where has values ​​of other fields in LocOrgTrab_ID field is null, and when I have the field values ​​LocOrgTrab_ID values the other fields are zero, and the LocOrgTrab_ID field is the table key to the future will relate to the fact but trying to make this relationship with fact not the right due to the aforementioned problem.

 

Ja I Sweetheart create the same LocOrgTrab_ID field in Table A but it is not possible, any suggestions of what I can do? there is a way of doing an INNER JOIN joining the two tables to make one and not bring information void?

If you need the data in the tables I can provide.

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@vitexo87

 

As @wonga mentioned, you can use "Merge Query" feature in Power BI Desktop. Just select columns you need to match and choose "Inner" in Join Kind. It will only join those matching rows.

 

Capture22.PNG

 

Regards,

View solution in original post

6 REPLIES 6
datavis
Resolver I
Resolver I

My two tables have most of the same headers but different records. When I merge queries, I get the new column at the far right of the table. The data does not merge whether I choose expand or aggregate. How do I get it to merge?

 

v-sihou-msft
Employee
Employee

@vitexo87

 

As @wonga mentioned, you can use "Merge Query" feature in Power BI Desktop. Just select columns you need to match and choose "Inner" in Join Kind. It will only join those matching rows.

 

Capture22.PNG

 

Regards,

Hi Guys,

I am trying to MERGE 2 table for my project and it keeps failing and I need some help.

 

Both the tables have 2 common column but with different names (SR_Number and SR_Num). Is that an issue?

 

@v-sihou-msft @wonga

 

I used this feature and made the relationship but that first time are experiencing some errors, the information at the end is not correct, I am investigating why but would have any tips on how to use this function?

wonga
Continued Contributor
Continued Contributor

@vitexo87

 

If you can provide some context as to what exactly is going wrong, it would be easier to troubleshoot. Please provide examples of what you started out with, what join you used and the resulting table of that join. Also provide, what output you expected. This way we can try and replicate it on our end and see where you may have went wrong, thanks.

wonga
Continued Contributor
Continued Contributor

@vitexo87

 

Have you tried using the "Merge Queries" feature in Power BI Desktop? The way that works is that you choose columns that are related to each other from each table and merge the two tables together based on those relationships.

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.