Forum Discussion
How to combine three columns into one?
Hi,
I have a table that has three columns (Zip codes columns). I want to combine all of them into one column that has all the zip codes. How can I do that?
13 Replies
- AnonymousNot applicable
- AnonymousNot applicable
CONCATENATE([col1],CONCATENATE([col2],[col3]))
- melianFrequent Visitor
Anonymous
The problem with this is that it combines them on the same line, which is not what I want. Your code would make the the new list looks like this
However, I want the new list to look like this
- melianFrequent Visitor
This is an example of what I want to do. In the table I am working on there are three columns, the first three, of zipcodes. I want to combine all of them into one column, All ZipCodes.
Anonymous
- v-chuncz-msft
Community Support
- bharatmalviFrequent Visitor
how to do the same using power query?
- jakobobNew Member
Hey!
There's no build in function in Power BI for that, but you can use M/Power query.(Source) => let result = Table.FromList(List.Combine(Table.ToColumns(Source)), null, {"AllZipCodes"}) in resultJust google for how to apply Power Query to your Power BI.
However this function replaces all your columns. If you want to keept the old columns you got to customize the function.Cheers Jakobob