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

Table.Sort function

image 1.jpgI am learning Table.Sort function, got blocked.

 

In Step3, the nested Table.Sort in Table.Group, it works

But when I try to split Step3 into 2 steps, I got blocked.

I think my understanding of the input and output of Table.Group and Table.Sort is still bit off.

Hope someone can help me understand better of "Table.Sort" function.

Thank you very much.

1 ACCEPTED SOLUTION
artemus
Microsoft Employee
Microsoft Employee

In step 3 you are sorting each entry in the group.

 

In step 5 you are trying to sort  a column of grouped entries. This won't work.

 

If you want to break it up, step 5 is:

 

Table.TransformColumns(Step4, {"B", each Table.Sort(_, {"Chinese"}))

View solution in original post

4 REPLIES 4
ImkeF
Community Champion
Community Champion

Hi @Anonymous ,

the sort order won't be kept until you use an additional Table.Buffer around it: https://community.powerbi.com/t5/Community-Blog/Bug-warning-for-Table-Sort-and-removing-duplicates-in-Power/ba-p/810390 

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

artemus
Microsoft Employee
Microsoft Employee

In step 3 you are sorting each entry in the group.

 

In step 5 you are trying to sort  a column of grouped entries. This won't work.

 

If you want to break it up, step 5 is:

 

Table.TransformColumns(Step4, {"B", each Table.Sort(_, {"Chinese"}))

Anonymous
Not applicable

Thanks for all the help @artemus , I trid your solution, it works. 

Just my understanding of Table.Group and Table.Sort, the output and input, and the datatype required for eah parameter, is still a bit off.

 

Image 1.jpg

dax
Community Support
Community Support

Hi @Anonymous , 

It seems that you solve the problem, right?  If so and if you'd like to, you could mark corresponding post as answer or share your solutions. That way, people who in this forum and have similar issue will benefit from it.

Best Regards,
Zoe Zhi

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

 

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!

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.

Top Kudoed Authors