Forum Discussion
VRMENDESadq
1 year agoFrequent Visitor
Return all values appearing in a given column
Hi, I need a column that returns all the values that appear in the "Class" column according to the "City" column, for example: City Class Result New York A A,B,C New York B A...
- 1 year ago
If you enter that code, by itself, into the Advanced Editor, it will reproduce your data table in your original post, (at the Source step), as well as the final result (at the last step).
If you look at your own query, you will probably also see a Step named "Source" which is where your data comes from.
If your data has the same structure as the sample in your original post, all you should need to do is replace one Source with the other (in the Advanced Editor).
Omid_Motamedise
1 year agoSuper User
Use this formula:
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Combine(List.Distinct(Table.SelectRows(Source,(x)=>x[City]=[City])[Class]),","))
in
#"Added Custom"VRMENDESadq
1 year agoFrequent Visitor
Doesn't work,
In my case I just need create a custom colunm not a table, do you can help me?
OBS: reinforcing that this example is just a slice of the data colunm, I have a much data in colunm City and Class, I just need a custom colunm with the logic.