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
spaturu3234
Frequent Visitor

How Do I Sort Text Columns

I have a column of descriptions , How Do I Sort that column ? So that I can compare with Previous value to identify multiple keys

 

ID    Desc

1      Apple

2      Ball

3      Cat

4      Apple

5      Cat

 

I need to sort this column:

ID      Desc

1        Apple

4        Apple

2        Ball

3        Cat

5        Cat

 

 

Final Output 

 

ID       Desc        CalColumn

1         Apple        1,4

2         Ball            2,6

3         Cat             NULL

 

OR

ID    Desc              CalColumn

1      Apple                 X

2      Ball                     NULL

3      Cat                      X

4      Apple                  X

5      Cat                      X

 

 

2 ACCEPTED SOLUTIONS
v-jiascu-msft
Microsoft Employee
Microsoft Employee

@spaturu3234

 

Hi,

 

Sorting will be easy. Click dropdown of the column and choose Sort Ascending in Query Editor. We also can add an index to keep the new order. Could you tell me the mean of the output? How Do I Sort Text Columns .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
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

Hi,

 

That all depends on the output you want. Dax has some funtions to do sorting work. But they don't work the way like sort here. Such as Rankx, TopN. 

 

Best Regards!

Dale.

Community Support Team _ Dale
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

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

@spaturu3234

 

Hi,

 

Sorting will be easy. Click dropdown of the column and choose Sort Ascending in Query Editor. We also can add an index to keep the new order. Could you tell me the mean of the output? How Do I Sort Text Columns .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Can I do that in Dax ?

Hi,

 

That all depends on the output you want. Dax has some funtions to do sorting work. But they don't work the way like sort here. Such as Rankx, TopN. 

 

Best Regards!

Dale.

Community Support Team _ Dale
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 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