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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
v-jiewu-msft
Community Support
Community Support

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
v-jiewu-msft
Community Support
Community Support

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.