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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to sort cloumn by custom?

How to sort column by custom

I want to sort column status by completed   error  cancel

Guide me please

1 ACCEPTED SOLUTION

On the tree dots of the bar you can select the sorting by percentage 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

12 REPLIES 12
MFelix
Super User
Super User

Hi @Anonymous ,

 

In this case you need to add an ID column that has one value per each one :

ID - Status

1 - Completed

2 - Error

3 - Cancel

 

On the query editor add a custom column with the following code:

if [status] = "Completed" then 1 else if [status] = "error" then 2 else 3

 

Then do a sort by


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix if​ i​ want​ sort completetd, on​ the​ way, cancel​, error​, blank

Guide​ me​ please.

The format is the same you just need to add additional syntax for each vbalue:

if [status] = "Completed" then 1 
else if [status] = "on the way" then 2 
else if [status] = "cancel" then 3
else if [status] = "error" then 4 else 5

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix   I want to sort status completetd, on​ the​ way, cancel​, error​, blank.

and If status = on the way I want to sort progress lowest to highest

 

adamasmay_0-1616295408029.png

 

Guide me please.

 

HI @Anonymous ,

 

For this you need to use the shift on the visualization table, you first sort by the Status and then keeping the SHIFT pressed you click on the progress


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix​​ then keeping the SHIFT pressed you click on the progress.

 

Please​ explain​ to​ me, I​ DON'T​ understand.

 

Hi @Anonymous ,

 

Check the link below with full explanation: 

https://www.c-sharpcorner.com/article/how-to-sort-a-table-using-multiple-columns-in-power-bi/#:~:text=Press%20Shift%20%2B%20Left%20Click%20on,on%20%E2%80%9COrder%20Date%E2%80%9D%20column.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix  If I want sort 2 option by step1 sort by status and sort by %progress.

Example if status = on the way , step 2 sort by %progress from ascending

 

Guide me please.

Anonymous
Not applicable

Hi @Anonymous ,

You can add one step in your Advanced Editor just like below screenshot:

yingyinr_0-1614918658320.png

#"Sorted Rows" = Table.Sort(#"Added Custom",{{"Custom", Order.Ascending}, {"%progress ", Order.Ascending}})​

Best Regards

 

 

Hi @Anonymous ,

 

Is this sorting to be made on a table visualization?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix  No, I use stacked bar chart visualization.

On the tree dots of the bar you can select the sorting by percentage 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors