Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have a column called Col1 which contian value like 456,123,789.
Meaning values within the column are seperated by comma.
I want to sort the value like 123,456,789.
Note - Some columns can have any set of values e.g. 123,456,789 or 123,678 or 456,123,491,756.
Is there anyway to do the sorting winthin a column.
Thanks in advance!
Solved! Go to Solution.
Hi,
This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Combine(List.Sort(Text.Split([Values],","),Order.Ascending),","))
in
#"Added Custom"
Hope this helps.
Hi,
This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Combine(List.Sort(Text.Split([Values],","),Order.Ascending),","))
in
#"Added Custom"
Hope this helps.
@vinothkumar1990 - you'll have to split the data in the column. In Power Query when you split column by delimeter, you can expand the advanced options and split by rows. Then you could sort the column, and if you really needed to recombine you could merge the data back together using a group by and custom function.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
62 | |
52 | |
39 | |
24 |
User | Count |
---|---|
85 | |
57 | |
45 | |
44 | |
36 |