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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
rkumar
Helper III
Helper III

Joining data from 3 columns into 1 column

Hi All,

In the table I am working on three columns, the first three are zipcodes. I want to combine all of them into one column, All ZipCodes. Union DAX syntax is not working for me. Please suggest the DAX.

 

zipcode.png

Thank You

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Thank You,

Instead of creating a union column we used slicer having souce from 3 columns , user below community link to get my work done. 

community.powerbi.com/t5/Desktop/How-to-filter-on-multiple-columns/td-p/380232  

View solution in original post

5 REPLIES 5
v-yingjl
Community Support
Community Support

Hi @rkumar ,

When using union() expression, you should note that:

  1. The two tables must have the same number of columns.
  2. Columns are combined by position in their respective tables.
  3. The column names in the return table will match the column names in table_expression1.
  4. Duplicate rows are retained.

You can create a new table to use union() expression:

All codes = 
        UNION(
        DISTINCT('Table'[Code1]),
        DISTINCT('Table'[Code2]),
        DISTINCT('Table'[Code3])
        )

You will get the expected result:

union result.png

Best Regards,
Yingjie Li

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

Hi Yingjie ,

I am using only one table, need to combine data from 3 columns of this table in one column. moreover the data of this new column has to be used in slicer so new table is not feasible. Please suggest.

 

Thank You

Hi @rkumar ,

I'm afraid you cannot create it in one table beacuse if you want to create a new column in the same table to combine other columns, there is no value which correspond with each row as the error message said 'A table of multiple values was supplied where a single value was expected' when you create a column need to have 9 rows while the columns you want to combine just have 3 rows.

 

Best Regards,
Yingjie Li

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

Thank You,

Instead of creating a union column we used slicer having souce from 3 columns , user below community link to get my work done. 

community.powerbi.com/t5/Desktop/How-to-filter-on-multiple-columns/td-p/380232  

amitchandak
Super User
Super User

Try

New table  = union(all(table[zipcode1]),all(table[zipcode2]),all(table[zipcode3]))

Or

new table = distinct(union(all(table[zipcode1]),all(table[zipcode2]),all(table[zipcode3])))

Also try

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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
Top Kudoed Authors