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
rafael_sa
Frequent Visitor

Merging multiple tables when not all individual rows are present in each table

Hi folks, 

 

I have a bunch of excel files for each month of the year. Each excel sheet in this file has some values/columns about some projects(public selections).

 

Information on each sheet is agreggated by project and year.

 

I have imported each sheet as a table and now i want to join.

 

To be more specific I'll share a screen of the contents.

 

What a i have is:

 

sheet 1 has this content

rafael_sa_0-1634327929354.png

sheet 2 this content

rafael_sa_1-1634327983563.png

sheet3 this content

rafael_sa_2-1634328069336.png

As you can see not all "chamada pública" are listed on each sheet, but a have created a unique identifier, that is related to the tuple ( "chamada publica", ano).

 

what I want to achieve is getting one unique table that has all the columns from all the sheets, but only one row for each tuple( chamada publica,ano,data_posição), like this:

 

rafael_sa_3-1634328521755.png

 As I mentioned before, i have imported each required sheet and then merged it with a table with all possible values for the tuple( chamada publica,ano), creating so a column named ID_CHAMADA. Hence, all the tables that i want to merge and get the columns has this identifier:

 

rafael_sa_5-1634329022866.png

How can i achieve that in powerbi ?

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @rafael_sa ,

 

Based on your description, do you want to get the field in each table and append it into a new table after removing the duplicate?

Please refer to the sample:

Table 2 = DISTINCT(UNION(DISTINCT('Table'[Column1]),DISTINCT('Table (2)'[Column1]),DISTINCT('Table (3)'[Column1])))


Best Regards,
Liang
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

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @rafael_sa ,

 

Based on your description, do you want to get the field in each table and append it into a new table after removing the duplicate?

Please refer to the sample:

Table 2 = DISTINCT(UNION(DISTINCT('Table'[Column1]),DISTINCT('Table (2)'[Column1]),DISTINCT('Table (3)'[Column1])))


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

PaulDBrown
Community Champion
Community Champion

You need to create dimension tables for all the fields common to both tables (including a date table for the date field) with unique values covering the range of values in each field. You then use the dimension fields to create the visuals, slicers, filters and in measures. 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.