Forum Discussion

plasmainthesky's avatar
plasmainthesky
New Member
2 years ago
Solved

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.

 

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.

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...

 

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

 

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

2 Replies

  • Anonymous's avatar
    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.

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

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

    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.