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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Sorting name column by order number column with more than one sort value for each name

Hi there, I want to sort the company name column by order number column, but the case is that e.g. for name Company X I have for version A order number 4 and for version B order number 5 (in the table we have several versions of hierarchy). Power BI can’t handle it, because each name must have only one unique order number.

 

I found a workaround for this:

  1. I open Power Query and filter the table, so there is only one version loaded into model
  2. I go to the Table view in Power BI Desktop and sort name column by order number column
  3. I reopen Power Query, remove the filter, which I set in step 1 and load the table into model, but this time with all versions

The sorting that I set up in step 2 remains and works, and theoretically should‘t, because one name now has more sort numbers.

 

Does someone know, if it is possible in my situation to sort the column in the above described way or it may happen that the sorting will be suddenly set to default or we receive error message the next time the data is loaded?

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

That should work since the validation occurs only once. After the validation is successful, the sorting will continue for additional rows.





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

When you click Close &Apply in the power query, power bi desktop will provide a dialog box display status,

When the loading is completed, power bi will save the state of your loading at this time as a .pbix file for later use

 

You can also directly splicing the parent level field and the child level field to form a new field for sortby

Company&Version = 'Table'[Company]&" "&'Table'[Version]

vyangliumsft_0-1653635684376.png

Result:

vyangliumsft_1-1653635684377.png

 

Best Regards,

Liu Yang

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

DataInsights
Super User
Super User

@Anonymous,

 

That should work since the validation occurs only once. After the validation is successful, the sorting will continue for additional rows.





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

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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