Forum Discussion
laurahoff97
1 year agoFrequent Visitor
Turn column with commas into multiple rows
I have a dataset that I need to transform in powerbi, but I am unsure of the right commands to get it how I want. Below is an example of how my data currently looks. However I want to take the r...
- 1 year ago
Hi laurahoff97 ,
For this you just need to use the split rows by delimiter and select the option rows on the the advance:
Cookistador
Super User
1 year agoHi laurahoff97
The easiest way to achieve that is to create a new table in Power query(reference of your existing table)
Delete all rows except IT owner and Company Code
Split IT Owner by delimiter: ,
Select Company Code and Unpivot other column
Remove Attribute column
You should get something like that:
Then you close and apply you link your new table to the previous one
Once your two tables are linked (via Company Code), you create a table, take IT owner from the new table and other fields from the previous one
this is the code I used in Power Query
let
Source = ITTable,
#"Removed Columns" = Table.RemoveColumns(Source,{"Manager", "Executive Owner", "Tags"}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Removed Columns", "IT Owners", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"IT Owners.1", "IT Owners.2", "IT Owners.3", "IT Owners.4"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"IT Owners.1", type text}, {"IT Owners.2", type text}, {"IT Owners.3", type text}, {"IT Owners.4", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Company Code"}, "Attribute", "Value"),
#"Removed Columns1" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"})
in
#"Removed Columns1"