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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

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

@Anonymous

 

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
Anonymous
Not applicable

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

@Anonymous

 

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?

 

Anonymous
Not applicable

@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

@Anonymous

 

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

@Anonymous

 

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.