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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Combine two columns into one without repeats

I'm doing an analysis about the schools in the municipality in an excel sheet I have the data of the schools in the initial years and in the other I have the final years. It happens that some schools have only initial years and others only final years, to solve this problem I wanted to create an auxiliary table with the name of all schools and exclude the repeated ones as shown below:

 

Table 1: Columns of school early years

ssiqueira_0-1658628015611.png

Table 2: Columns of school final years

ssiqueira_1-1658628135294.png

 

Table that I want to create:

 

ssiqueira_2-1658628170317.png

 

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

Hi, @Anonymous 

If you want to get the name list of all schools, please try calculated table as below:

Table = DISTINCT(UNION(VALUES('Early years schools'[School Name]),VALUES('Final years schools'[School Name])))

veasonfmsft_0-1658918890573.png

or

Table 2 = DISTINCT(UNION('Early years schools','Final years schools'))

veasonfmsft_1-1658918909012.png

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

If you want to get the name list of all schools, please try calculated table as below:

Table = DISTINCT(UNION(VALUES('Early years schools'[School Name]),VALUES('Final years schools'[School Name])))

veasonfmsft_0-1658918890573.png

or

Table 2 = DISTINCT(UNION('Early years schools','Final years schools'))

veasonfmsft_1-1658918909012.png

Best Regards,
Community Support Team _ Eason

MahyarTF
Memorable Member
Memorable Member

Hi,

I my opinion, you need to Alter Clumn name in both table and use same title for both, or add the new column in each table with common name, then Append those an delete other column and also Rmove Duplicated rows :

MahyarTF_0-1658636611167.png

MahyarTF_2-1658636637931.png

MahyarTF_3-1658636685346.png

Mahyartf
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, rename the column heading of one table to exactly match the Other.  Append the 2 tables and the Remove Duplicates.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors