Forum Discussion
CMC
4 years agoHelper I
Extract List to new Column
I'm pulling some data from Sharepoint Lists using a Dropdown, when the data come into Power BI it looks like the below, whats the easiest way of creating a new Column, I need all of the data , e.g. C...
- 4 years ago
Just leave code part. I think Extract values part will be very easy for you (it will generated required code automatically)
click the doubled edge arrow and Extract values.
Choose custom and then select Concatenate using special characters - Insert Special Characters - Select Line Feed - OK
Vijay_A_Verma
4 years agoMost Valuable Professional
Do you need this kind of output?
If yes - See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIxNVWK1YlWcgKyDY3MLZRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Customer = _t, Sales = _t]),
#"Added Custom" = Table.AddColumn(Source, "Choices", each if [Customer] = "A" then {"C2","C2","C3"} else {"C4","C5"}),
#"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Choices", each Text.Combine(List.Transform(_, Text.From), "#(lf)"), type text})
in
#"Extracted Values"CMC
4 years agoHelper I
Yes the only column I'm interested in the Choices Column and to get the data extracted, there is requirement to look at the customer specifically , that code you are looking for specific values, how do you make it generic to just create the new column and data?