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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
plasmainthesky
New Member

sort by column not working

Hi all.

 

In my I have a column called proj_stage_group, and another column called proj_stage_num that is mapped 1 to 1 to proj_stage_group.

 

plasmainthesky_0-1712954128795.png

I am trying to sort proj_stage_group by proj_stage_num in Power Bi, but it keeps telling me it can't sort proj_stage_group by proj_stage_num because there can't be more than one value in proj_stage_num for the same value in proj_stage_group, even though there clearly isn't.

plasmainthesky_1-1712954273955.png

I thought that maybe the null value was affecting it, but when I remove null values in the power query editor, I get the same result.

 

Then I went an created a whole new table in power query with just two columns of the same names and the same data, and got the same behavior...

plasmainthesky_2-1712955146085.png

plasmainthesky_4-1712955172861.png

 

 ... but when I changed the column names to colA and colB, sort by column worked as expected.

plasmainthesky_0-1712955306948.png

 

Any idea what's happening here?

 

I've read through a bunch of posts trying to figure out what's happening and haven't find anything that helps me.

 

Thank you!!!

Eli

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @plasmainthesky ,

First of all, many thanks to @lbendlin  for your very quick and effective replies, and I will give some additions below:

1.Create the sample table.

vjiewumsft_0-1713160236488.png

2.Select the stage_group field and choose sort by stage_num column.

vjiewumsft_1-1713160253145.png

vjiewumsft_2-1713160264885.png

3.The stage_group column sort by num column without errors.

vjiewumsft_3-1713160274561.png

You can also view the following document to learn more about sort by column.

Sort one column by another column in Power BI - Power BI | Microsoft Learn

 

Best Regards,

Wisdom Wu

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 @plasmainthesky ,

First of all, many thanks to @lbendlin  for your very quick and effective replies, and I will give some additions below:

1.Create the sample table.

vjiewumsft_0-1713160236488.png

2.Select the stage_group field and choose sort by stage_num column.

vjiewumsft_1-1713160253145.png

vjiewumsft_2-1713160264885.png

3.The stage_group column sort by num column without errors.

vjiewumsft_3-1713160274561.png

You can also view the following document to learn more about sort by column.

Sort one column by another column in Power BI - Power BI | Microsoft Learn

 

Best Regards,

Wisdom Wu

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

lbendlin
Super User
Super User

You still have a blank row in your reference table.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.