Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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?
Solved! Go to Solution.
You may select Unpivot Columns in the Query Editor or use UNION Function in DAX.
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
result Just 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
how to do the same using power query?
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
Hi,
Use Summarize with union function as shown below-
@AngadK , i have a similar requirement, tried the union dax with Summarize its throwing an error, can you please help me with this
@Anonymous , Have you written the union dax formula on "Create a new table using DAX" pane?
@Anonymous , i got if after using the dax in a new table, is it possible to combine them in the same table?
What i want: am planning to show the hours spent on each project on a particular date, i have 4 columns of project IDs for each person everyday hence i want to combine the IDs into one column.
Hi Melian, Can you please post your solution DAX . I have the same requirement but UNIOn is not working in my case.
You may select Unpivot Columns in the Query Editor or use UNION Function in DAX.
@v-chuncz-msft Thank you so much. The UNION function did the job. Much appreciated.
CONCATENATE([col1],CONCATENATE([col2],[col3]))
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 39 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |