Forum Discussion
dealing with column which has mulitple values
- 2 years ago
Hello! In Power Query you are going to want to split by delimeter, then unpivot other columns. This way you wind up with a table that looks like this:
Instead of this:
With it in the new format, you can have your slicer do what you wanted:
If I click Mazda, we can see jean and john appear.
Hello! In Power Query you are going to want to split by delimeter, then unpivot other columns. This way you wind up with a table that looks like this:
Instead of this:
With it in the new format, you can have your slicer do what you wanted:
If I click Mazda, we can see jean and john appear.
- Anonymous2 years agoNot applicable
thank you for you reply just i need to know once i do the step ( unpivot other colum ) on which column shoud i select ?
- audreygerred2 years ago
Super User
I was on the name column when I did that step. Here is the M code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WykpMzlbSUQrJr8wvSdTxyywuTszTcc5ILSvKz0ktUYrVASrJz8gDKvFNrEpJ1IEohIgn5qYWAyWgmtx9nXXc8otSoHLF+SBNCIHURLghYIGiTLDFcKvgJscCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Cars = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Cars", type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Cars", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Cars.1", "Cars.2", "Cars.3"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Cars.1", type text}, {"Cars.2", type text}, {"Cars.3", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {"Name"}, "Attribute", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"})
in
#"Removed Columns"- Anonymous2 years agoNot applicable
god bless you it works with me