Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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. Choice 1, Choice 2, Choice 3
Solved! Go to Solution.
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
I can convert the list to a table but that then over writes all of the data in the query and only the table is viewable. I could duplicate it then create the table but then the relationships are lost. So if the Dropdown Column list can be converted into a new column that is the best solution.
So when you have a list containing {"a","b","c"} and when you extract it to a column, it comes as a,b,c in a single column. You need not split it.
But I think I am not able to understand the exact problem. If you can tell me by taking an example of a list and what output do you need, I will be able to help out.
When I do the extract the column is updated to reflect:
Choice 2Choice3
I need the column to show
Choice 2
Choice 3
When extracting select Extract to Rows.
That will work but the problem then is that then introduces rows with duplicate content, how can I get the data all within the same row?
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"
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?
Can you open one list and post here the screenshot and then you can describe what output you want...
Ok sure..
1. Extract the values from the list field, which could be anything, e.g. Apple, Pear, Carrot
2. Create a new colum with those values so it looks like
That is what I had done...You need to insert this statement in your code where you need to replace #"Added Custom" with previous step.
To do this, right click on last step of your query - Insert step after (now in formula bar, it would show your previous step which you should copy) and paste the below one into Formula bar and replace #"Added Custom" with your previous step
= Table.TransformColumns(#"Added Custom", {"Choices", each Text.Combine(List.Transform(_, Text.From), "#(lf)"), type text})
Now, if you are not able to do so, then click the doubled edge arrow and Extract values.
Choose custom and then select Concatenate using special characters - Insert Special Characters - Select Line Feed - OK
Sorry you lost me there, can you post the full code?
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
thats the one! Sorry we got there in the end! Many thanks
Simplest way is to click double edged arrow at the top and extract the data into a new column which will have combined text. Then you can split the column.
That will work but the issue is if you update the DropDown value in Sharepoint, e.g. Choice 4 it creates another value which BI doesn't know anything about.. So ideally its a new column with all the data
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
29 | |
12 | |
12 | |
11 | |
8 |
User | Count |
---|---|
53 | |
27 | |
15 | |
14 | |
13 |