Mcode inside "Text.Combine" not responding to a sort

Guitarmageddon

Board Regular
Joined
Dec 22, 2014
Messages
161
Hey folks, I have the below step in my query which is taking the dates, grouped by the four fields in the "Table.group" and its using "text.combine" to put all of the "run dates" into one cell. I added a "list.sort" function inside the text.combine, but in the output, its still apparently not following the sort. Is this something about date/text formats?

Here is the code
Power Query:
= Table.Group(#"Renamed Columns", {"DUNS","GEN", "GEN_NAME", 
"SHIPPED_TO_SITE","MIN_NOTES"}, {{"Run Occurences", each Table.RowCount(List.Distinct(_[RUN_DATE])), Int64.Type},
{"Order Dates", each Text.Combine(List.Sort(List.Distinct(_[RUN_DATE]),Order.Ascending),", ")}
}
)

Here is what I see in the output, for example, youll see 9-4 there as the last date when I would expect 9-28.
1695914899172.png
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Can you post the table? Probably convert to number, sort the list, then transform back to date format. Finally, combine them
 
Upvote 0
Can you post the table? Probably convert to number, sort the list, then transform back to date format. Finally, combine them
Unfortunately no luck messing with this., Im wondering if this is an issue that Table.Buffer can resolve? I tried putting it into the various steps, but not sure where I should be using it. Any thoughts?
 
Upvote 0
Maybe you can try
Power Query:
Text.Combine(List.Transform(List.Sort(_[RUN_DATE], each Text.From(_), Order.Ascending)), ", ")
 
Upvote 0

Forum statistics

Threads
1,223,315
Messages
6,171,412
Members
452,399
Latest member
oranges

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top