Pivot Table Column Item from Power Query Connected Data Not in Numeric Order


I've been searching around but couldn't find the answer to this.


I loaded to my data model and connection only from my raw data source into a new sheet for use.


In my raw data I have an order number of how things should be grouped; that is, all items in group 1 appear first, then group 2, and so on in proper numerical order. What happens instead is it will order it based on the leading value and numerically. 


I will sum my data and using the first column this order # to put the accounts in proper order that's needed. I checked in PQ and didn't notice anything I could change, searched around and didn't find anything that could affect it. The column that generates this value is a formula as new accounts get added every now and then. I'm not sure how to fix this.


Example from my data:

Screen Shot 2021-07-12 at 6.15.43 PM.png


Thank you for any help.

3 Replies
best response confirmed by Jpalaci1 (Contributor)


It looks like Order # are texts, did you try to convert them to numbers?

Thank you. I fixed in Query editor by changing the type to number and fixed it.

I overlooked this as in Excel it worked fine until I had an IFERROR that added a blank (“”) and changes that to a zero, changed the type to a number with decimals, let it update the data model, and made sure on PQ it was a number just in case.

Thank you for the help. I overlooked the simple mistake.