Forum Discussion
Kagliostro
1 year agoFrequent Visitor
Sort text in a single cell
Hi everyone, I am would like to sort out text in a single cell and to do so I found in this forum a script in M which would fit perfectly with my need (link). However, while the majority of cells wo...
- 1 year ago
There shouldn't be an error, but try this code anyway
=[ f = (x) => Text.Combine(List.Sort(List.Transform(Text.Split(x, ","), Text.Trim)), ","), Split = try f([NAME_ASSIGNED]) otherwise [NAME_ASSIGNED] ][Split]
Omid_Motamedise
1 year agoSuper User
Rewrite the first step by the below formula
Split = if Text.Contains([NAME_ASSIGNED],",") then Text.Split([NAME_ASSIGNED], ",") else {[NAME_ASSIGNED]},