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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss 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.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors