Forum Discussion
Anonymous
5 years agoNot applicable
Search from multiple columns
I have a table with multiple columns. The table is about users usage of different applications. The same application can be in any column. For user one it can be in column 1 and for user two in colum...
- 5 years ago
Anonymous - I have attached a PBIX file with what I think you attempting to accomplish.
Power Query
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckwpSk1U8NZT0lEKyC9PLXLyVAgoysfgKcXqANXmpFYouGEq9c1MLsovzk8rUTA2M1VwNQYpKMrPSk0uUQjQA+v0rsxJVXDXQ5VAGONWlJqKZipclw82hciGgJX6JhZVYnMaRSozc1IrFYL0CPoQzX0gvSEZ+bmJxQrBGF6GGR6Sn6sQgstotKCPBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [DisplayName = _t, Products1 = _t, Products2 = _t, Products3 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"DisplayName", type text}, {"Products1", type text}, {"Products2", type text}, {"Products3", type text}}), #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"DisplayName"}, "Attribute", "Value"), #"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each ([Value] <> "")) in #"Filtered Rows"
ChrisMendoza
Resident Rockstar
5 years agoAnonymous - To me it seems you are describing your data as cross-tabulated and you need to un-pivot the columns which can easily be done in Power Query. Please reply with a sample of your data (be sure to remove sensitive data) so we can further assist you.
Anonymous
5 years agoNot applicable
So my data looks like this but has more columns and rows. For example I should search all the users using Project P.
- ChrisMendoza5 years ago
Resident Rockstar
Anonymous - I have attached a PBIX file with what I think you attempting to accomplish.
Power Query
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckwpSk1U8NZT0lEKyC9PLXLyVAgoysfgKcXqANXmpFYouGEq9c1MLsovzk8rUTA2M1VwNQYpKMrPSk0uUQjQA+v0rsxJVXDXQ5VAGONWlJqKZipclw82hciGgJX6JhZVYnMaRSozc1IrFYL0CPoQzX0gvSEZ+bmJxQrBGF6GGR6Sn6sQgstotKCPBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [DisplayName = _t, Products1 = _t, Products2 = _t, Products3 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"DisplayName", type text}, {"Products1", type text}, {"Products2", type text}, {"Products3", type text}}), #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"DisplayName"}, "Attribute", "Value"), #"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each ([Value] <> "")) in #"Filtered Rows"