Forum Discussion
Combine columns by stacking on new table
- 1 year ago
Select your columns and then Unpivot Columns (under Transform tab).
Should be left with this
And you can split the columns to get the names!
Hi NBADM ,
You can achive this using Unpivot Columns.
To achieve this transformation in Power BI, start by loading your data into the Power Query Editor. Once in the editor, select the columns "Satisfied with Joe," "Satisfied with Jane," and "Satisfied with Jerry." Then, use the "Unpivot Columns" option, which can be accessed by right-clicking on the selected columns. This will transform the selected columns into rows, creating a table with two columns: one containing the original column headers and the other containing the corresponding values.
After unpivoting, rename the first column (which holds the original headers) to "Name" and the second column to "Satisfied." To clean up the "Name" column so it only contains the names (e.g., "Joe," "Jane," "Jerry"), use the "Transform" tab, selecting "Extract" and then "Text After Delimiter." Specify "with " as the delimiter to remove the "Satisfied with" prefix from each value.
Finally, close and apply the changes to load the transformed table back into Power BI. The resulting table will have two columns: "Satisfied" and "Name." It will now be in the desired format, making it easy to filter or use in visuals for analysis.
Best regards,