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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
rashidanwar
Advocate II
Advocate II

Sorting a string separated by comma using Dax

Hi everybody 

I have a column containing some string values that is actually result of this Dax expression. Now as a result of the mentioned Dax I am getting an output which is actually same but the order makes it different.

For example I am getting 3 values in the column as follow.

Belgium, France, Italy 
France, Belgium, Italy
Italy, France, Belgium

Technically they are same but order is making them different. So I want to first sort them and want to make a single value of Belgium, France, Italy

I would appreciate any help in this regard. 
Thank you.
Rashid Anwar

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rashidanwar ,

Does each row have these 3 values? If it is, please have a try.

Measure = "Belgium, France, Italy "

11.PNG

 

If I have misunderstood your meaning, please contact me and provide  more details.

 

Best Regards

Community Support Team _ Polly

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @rashidanwar ,

Does each row have these 3 values? If it is, please have a try.

Measure = "Belgium, France, Italy "

11.PNG

 

If I have misunderstood your meaning, please contact me and provide  more details.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

amitchandak
Super User
Super User

@rashidanwar , Create a new column in power query

= Text.Combine(List.Sort(Text.Split([Column1], ", ")), ", ")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.