Forum Discussion
Group rows, concatenate then sort concatenated value alphabetically
Hi all,
So I've got a table with rows containing item line numbers and a group ID.
I've then managed to group them together and concatenate by a delimiter following the below post:
This is technically what it suppose to look like
But when I go to add the concatenated values into a bar chart I noticed that the concatenated items are concantenated in an alphabetical order so even though technicall two grouped values have the same concatenated item value, BI treats them as two different things due to the order of the concatenated value. Is it possible to sort them alphabetically first then group them?
Kind regards,
Mike
6 Replies
- Mike282
Helper III
Thanks parry2k . I tried using the order.ascending function but it doesn't seem to sort correctly. Could you let me know what I need to sort? Below is the M script snippet for when I grouped the value:
#"Sorted Rows" = Table.Sort(#"Expanded Items",{{"Items.Item", Order.Ascending}}), #"Grouped Rows" = Table.Group(#"Sorted Rows", {"Group"}, {{"Item Value", each Text.Combine([Items.Item],"|"), type text}}),