Forum Discussion

Kagliostro's avatar
Kagliostro
Frequent Visitor
1 year ago
Solved

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...
  • Ahmedx's avatar
    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]