Forum Discussion
Lookup the cells in same row
- 5 years ago
Hi Anonymous ,
Are you trying to create a new column to combine all other columns? You don't need to unpivot the columns , just use the following m query:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8kpMzlbSUfIPtlIIz8xLyS8vBvJQUKxOtFJQJlgVhsKQyoJUH5fU4uyS/AKIJFROITi1qCy1SMHIwNAMVcLIwMAAm1Kl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}}), result = Table.AddColumn(#"Changed Type","column10",each Text.Combine(List.RemoveNulls(List.Select(Record.ToList(_),(x)=>Text.Contains(x,"OS"))),"|")), #"Replaced Value" = Table.ReplaceValue(result,"OS:","",Replacer.ReplaceText,{"column10"}) in #"Replaced Value"Please refer to the pbix file.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
- Anonymous5 years ago
v-deddai1-msft Thank You and I tried the code. It is giving me error as shown below. I cannot figure out to move further.
Expression.Error: We cannot convert the value 103068199 to type Text.
Details:
Value=103068199
Type=[Type]I have a column ID and one of the cell has 103068199 as the value. Can you please help
Anonymous
what about in step 2, filter only windows related results?
No in Step 2 nothing. Actually there are different TAGS like OS: , LOC:, TYPE: in the row for each asset. But this order is changing in every row. If the order is not changing then we can merge or group it.
If the text search or lookup in row is working i have to do the same for all different tags.
- ryan_mayu5 years ago
Super User
Anonymous
does this your rawdata look like?
Do you want to get the result in red? please see if the attachment below helps