Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Aden123
Regular Visitor

Sort data in descending order in same cell

I have some data that needed sorting in the same cell.

 

Current data

ABC019, ABC018, ABC010

 

Expected results

ABC010, ABC018, ABC019

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@Aden123 

I am glad to help you. 

According to your description, actually you want to sort data in ascending order in same cell? 

If I understand you correctly, then you can refer to my solution. 

 

1.Import the data into Power BI Desktop and click Transform data to open Power Query Edit. 

vfenlingmsft_0-1719379117631.png

 

 

2.Choose Custom Column in Power Query Edit. 

vfenlingmsft_1-1719379132314.png

 

3.Enter M language formulas to create new columns 

vfenlingmsft_2-1719379151357.png

 

 

let
    Source = [Current data],
    SplitColumn = Text.Split(Source, ","),
    SortedList = List.Sort(SplitColumn, Order.Ascending),
    CombinedText = Text.Combine(SortedList, ",")
in
    CombinedText

 

Result : 

vfenlingmsft_3-1719379168274.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi,@Aden123 

I am glad to help you. 

According to your description, actually you want to sort data in ascending order in same cell? 

If I understand you correctly, then you can refer to my solution. 

 

1.Import the data into Power BI Desktop and click Transform data to open Power Query Edit. 

vfenlingmsft_0-1719379117631.png

 

 

2.Choose Custom Column in Power Query Edit. 

vfenlingmsft_1-1719379132314.png

 

3.Enter M language formulas to create new columns 

vfenlingmsft_2-1719379151357.png

 

 

let
    Source = [Current data],
    SplitColumn = Text.Split(Source, ","),
    SortedList = List.Sort(SplitColumn, Order.Ascending),
    CombinedText = Text.Combine(SortedList, ",")
in
    CombinedText

 

Result : 

vfenlingmsft_3-1719379168274.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.